Skip to content

Instantly share code, notes, and snippets.

@ShunsukeHirota
Last active February 27, 2017 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShunsukeHirota/e841e70a3fd098372da0fed3ce034fa8 to your computer and use it in GitHub Desktop.
Save ShunsukeHirota/e841e70a3fd098372da0fed3ce034fa8 to your computer and use it in GitHub Desktop.
ExtractTextPluginの使い方(webpack) ref: http://qiita.com/tmw/items/dce42bb2d92fa208fe10
Module parse failed: 〜中略〜 Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
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