Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ExtractCssChunks.loader,
cssLoader,
postCssLoader,
stylusLoader,
]
} else if (stage === 'node') {
// Node
// Don't extract css to file during node build process
loaders = [cssLoader, postCssLoader, stylusLoader]
} else {
// Prod
// for legacy css-loader version (<2.0) we need to add "minimize" to minify css code
// for >2.0 it is handled with https://github.com/NMFR/optimize-css-assets-webpack-plugin
const cssLoaderVersion = require('css-loader/package.json').version
if (semver.satisfies(cssLoaderVersion, '<2') === true) {
cssLoader.options.minimize = true
}
loaders = [
ExtractCssChunks.loader,
cssLoader,
postCssLoader,
stylusLoader,
]
}
config.module.rules[0].oneOf.unshift({
test: /\.styl$/,
use: loaders,
})
},
cssLoader,
postCssLoader,
sassLoader,
]
} else if (stage === 'node') {
// Node
// Don't extract css to file during node build process
loaders = [cssLoader, postCssLoader, sassLoader]
} else {
// Prod
// for legacy css-loader version (<2.0) we need to add "minimize" to minify css code
// for >2.0 it is handled with https://github.com/NMFR/optimize-css-assets-webpack-plugin
const cssLoaderVersion = require('css-loader/package.json').version
if (semver.satisfies(cssLoaderVersion, '<2') === true) {
cssLoader.options.minimize = true
}
loaders = [ExtractCssChunks.loader, cssLoader, postCssLoader, sassLoader]
}
config.module.rules[0].oneOf.unshift({
test: /\.s(a|c)ss$/,
use: loaders,
})
if (
config.optimization.splitChunks &&
config.optimization.splitChunks &&
config.optimization.splitChunks.cacheGroups.styles
) {
},
cssLoader,
postCssLoader,
lessLoader,
]
} else if (stage === 'node') {
// Node
// Don't extract css to file during node build process
loaders = [cssLoader, postCssLoader, lessLoader]
} else {
// Prod
// for legacy css-loader version (<2.0) we need to add "minimize" to minify css code
// for >2.0 it is handled with https://github.com/NMFR/optimize-css-assets-webpack-plugin
const cssLoaderVersion = require('css-loader/package.json').version
if (semver.satisfies(cssLoaderVersion, '<2') === true) {
cssLoader.options.minimize = true
}
loaders = [ExtractCssChunks.loader, cssLoader, postCssLoader, lessLoader]
}
config.module.rules[0].oneOf.unshift({
test: /\.less$/,
use: loaders,
})
return config
},
})