Skip to content

Instantly share code, notes, and snippets.

@phun-ky phun-ky/webpack.config.js
Last active Jul 10, 2018

What would you like to do?
webpack + postcss + extract-text-plugin = no CSS duplicates
postcss: () => {
return [
reduceIdents: false,
discardDuplicates: true,
autoprefixer: true
},modules: {
loaders: [{
test: test_expressions.css,
loader: extractTextPlugin.extract('css-loader?importLoaders=1!postcss-loader')
test: test_expressions.stylus,
loader: extractTextPlugin.extract('css-loader?importLoaders=2!postcss-loader!stylus-loader')
plugins: [
new extractTextPlugin('[name].css'),
new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2017

If you want to use this in dev, you will have to use a plugin like write-file-webpack-plugin to force webpack to write the file to disk in dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.