Skip to content

Instantly share code, notes, and snippets.

@kotojo kotojo/webpack.js
Last active May 10, 2017

Embed
What would you like to do?
scss webpack issue
// webpack.config.js
const productionConfig = () => merge([
parts.extractSCSS({
use: [
{
loader: 'css-loader',
module: true
}, {
loader: 'sass-loader',
},
],
}),
]);
//webpack.parts.js
const ExtractTextPlugin = require('extract-text-webpack-plugin');
exports.extractSCSS = ({ include, exclude, use }) => {
const plugin = new ExtractTextPlugin({
filename: '[name].[contenthash].css',
disable: process.env.NODE_ENV === 'development',
});
return {
module: {
rules: [
{
test: /\.scss$/,
include,
exclude,
use: plugin.extract({
use,
fallback: 'style-loader',
}),
},
],
},
plugins: [plugin],
};
};
@XuNanIntelif

This comment has been minimized.

Copy link

commented May 10, 2017

May i have your email?

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.