Skip to content

Instantly share code, notes, and snippets.

@jarshwah
Created April 7, 2018 11:02
Show Gist options
  • Save jarshwah/53fbf5b762d9bb0e1aa7db7424cfc65f to your computer and use it in GitHub Desktop.
Save jarshwah/53fbf5b762d9bb0e1aa7db7424cfc65f to your computer and use it in GitHub Desktop.
module: {
rules: [
// ...
// Rules for Style Sheets
{
test: /\.(scss|sass)$/,
include: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'assets/scss')],
use: extractSass.extract({
use: [
// Process internal/project styles (from assets/scss folder)
{
loader: 'css-loader',
options: {
// CSS Loader https://github.com/webpack/css-loader
importLoaders: 1,
sourceMap: isDebug,
// CSS Modules https://github.com/css-modules/css-modules
modules: true,
localIdentName: isDebug
? '[name]-[local]-[hash:base64:5]'
: '[hash:base64:5]',
// CSS Nano http://cssnano.co/
minimize: isDebug ? false : minimizeCssOptions,
},
},
{ loader: 'postcss-loader', options: { sourceMap: isDebug } },
{ loader: 'sass-loader', options: { sourceMap: isDebug } },
],
fallback: 'style-loader',
}),
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment