Skip to content

Commit

Permalink
Initialize ExtractTextPlugin once #64
Browse files Browse the repository at this point in the history
Output a single css file
  • Loading branch information
catalinmiron authored and chentsulin committed Oct 24, 2015
1 parent e144dc1 commit 395c407
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions webpack.config.production.js
Expand Up @@ -15,18 +15,15 @@ config.entry = './app/mainApp';

config.output.publicPath = '/dist/';

var stylesTextPlugin = new ExtractTextPlugin('style.css', { allChunks: true });
var globalStylesTextPlugin = new ExtractTextPlugin('global-style.css', { allChunks: true });

config.module.loaders.push({
test: /^((?!\.module).)*\.css$/,
loader: globalStylesTextPlugin.extract(
loader: ExtractTextPlugin.extract(
'style-loader',
'css-loader'
)
}, {
test: /\.module\.css$/,
loader: stylesTextPlugin.extract(
loader: ExtractTextPlugin.extract(
'style-loader',
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
)
Expand All @@ -44,8 +41,7 @@ config.plugins.push(
warnings: false
}
}),
stylesTextPlugin,
globalStylesTextPlugin
new ExtractTextPlugin('style.css', { allChunks: true })
);

config.target = webpackTargetElectronRenderer(config);
Expand Down

0 comments on commit 395c407

Please sign in to comment.