Last active
May 10, 2017 08:53
-
-
Save kotojo/519461e9152a51fb1310717d9d4a334e to your computer and use it in GitHub Desktop.
scss webpack issue
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
// 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], | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
May i have your email?