Skip to content

Instantly share code, notes, and snippets.

@jarshwah
Created April 7, 2018 11:02
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 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