Last active
February 27, 2017 09:21
-
-
Save ShunsukeHirota/e841e70a3fd098372da0fed3ce034fa8 to your computer and use it in GitHub Desktop.
ExtractTextPluginの使い方(webpack) ref: http://qiita.com/tmw/items/dce42bb2d92fa208fe10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module parse failed: 〜中略〜 Unexpected character '@' (1:0) | |
You may need an appropriate loader to handle this file type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ExtractTextPlugin = require('extract-text-webpack-plugin') | |
, extractTextPlugin = new ExtractTextPlugin('stylesheets/[name].css'); | |
module.exports = { | |
entry: { | |
'index': [ | |
'./src/javascripts/modules/main/indexmain.js' | |
], | |
'others': [ | |
'./src/javascripts/modules/main/othersmain.js' | |
] | |
}, | |
output: { | |
path: path.join(__dirname, 'dist/assets/'), | |
filename: "javascripts/[name].bundle.js" | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/}, | |
{ test: /\.css$/, loader: extractTextPlugin.extract("css-loader")}, | |
{ test: /\.scss$/, loader: extractTextPlugin.extract("css!sass")}, | |
] | |
}, | |
plugins: [ | |
extractTextPlugin | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment