Skip to content

Commit

Permalink
add loader for css again
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelknoch committed Aug 30, 2016
1 parent f3c961a commit cd8d357
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ loaders.push({
'css'
]
});
// local css modules
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loaders: [
Expand All @@ -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}`,
Expand Down
6 changes: 6 additions & 0 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit cd8d357

Please sign in to comment.