From cd8d3571ce1262bcaf4983500d3593e999df19f0 Mon Sep 17 00:00:00 2001 From: Michael Knoch Date: Tue, 30 Aug 2016 22:57:12 +0200 Subject: [PATCH] add loader for css again --- webpack.config.js | 11 ++++++++++- webpack.production.config.js | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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')