Created
December 22, 2016 21:46
-
-
Save gavindoughtie/12f867d1d6bb7477b478f1673ce19663 to your computer and use it in GitHub Desktop.
parts.js extractCSS attempt for Webpack2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.extractCSS = function(paths) { | |
return { | |
module: { | |
rules: [ | |
// Extract CSS during build | |
{ | |
test: /\.css$/, | |
include: paths, | |
loader: ExtractTextPlugin.extract({ | |
fallbackLoader: 'style-loader', | |
loader: [{loader: 'css-loader', query: { modules: true, importLoaders: 2 }}] | |
}) | |
} | |
], | |
}, | |
plugins: [ | |
// Output extracted CSS to a file | |
new ExtractTextPlugin({ | |
filename: '[name].[chunkhash].css', | |
disable: false, | |
allChunks: true | |
}) | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment