Skip to content

Instantly share code, notes, and snippets.

@bazuzu931
Last active January 29, 2018 07:43
Show Gist options
  • Select an option

  • Save bazuzu931/66ff90cbf096e1e86f8b1445b64299bb to your computer and use it in GitHub Desktop.

Select an option

Save bazuzu931/66ff90cbf096e1e86f8b1445b64299bb to your computer and use it in GitHub Desktop.
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = function(paths) {
return {
module: {
rules: [
{
test: /\.scss$/,
include: paths,
use: ExtractTextPlugin.extract({
publicPath: '../',
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
},
{
test: /\.css$/,
include: paths,
use: ExtractTextPlugin.extract({
publicPath: '../',
fallback: 'style-loader',
use: ['css-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('css/[name].css')
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment