diff --git a/webpack.config.js b/webpack.config.js index dd617b7..c73c415 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,7 @@ loaders.push({ 'css' ] }); -// local css modules +// local scss modules loaders.push({ test: /[\/\\]src[\/\\].*\.scss/, loaders: [ @@ -25,6 +25,15 @@ loaders.push({ ] }); +// local css modules +loaders.push({ + test: /[\/\\]src[\/\\].*\.css/, + loaders: [ + 'style?sourceMap', + 'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]' + ] +}); + module.exports = { entry: [ `webpack-dev-server/client?http://${HOST}:${PORT}`, diff --git a/webpack.production.config.js b/webpack.production.config.js index cf33152..645c9e1 100644 --- a/webpack.production.config.js +++ b/webpack.production.config.js @@ -6,6 +6,12 @@ var HtmlWebpackPlugin = require('html-webpack-plugin'); var WebpackCleanupPlugin = require('webpack-cleanup-plugin'); // local css modules +loaders.push({ + test: /[\/\\]src[\/\\].*\.css/, + loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]') +}); + +// local scss modules loaders.push({ test: /[\/\\]src[\/\\].*\.scss/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass')