Skip to content

Instantly share code, notes, and snippets.

@kotojo
Last active May 10, 2017 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kotojo/519461e9152a51fb1310717d9d4a334e to your computer and use it in GitHub Desktop.
Save kotojo/519461e9152a51fb1310717d9d4a334e to your computer and use it in GitHub Desktop.
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
Copy link

May i have your email?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment