-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change include/exclude for a loader #254
Comments
TL;DR: module.exports = {
rules: {
'sass-pipeline': {
exclude: /sketch-web-components/
},
'sass-css': {
modules: true
}
}
} It looks like you're trying to configure one of the use-cases I intend to explicitly support in #223 - using CSS modules on only part of a project. Unfortunately, you currently only get two rules to configure for CSS by default and two for each style preprocessor plugin you use - one for your app's own styles ( This was something which pickled my brain a bit when converting to Webpack 2...Webpack 2 now has you provide Chaining loaders in Webpack 1 was a hack - you provided a big string with multiple loaders in it. This is no longer the case in Webpack 2, which has first-class support for rules which chain multiple loaders specified using the new For style pipelines, you now have 2 truly separate parts - the rule, which owns the |
Thanks @insin. In my case I wanted to exclude a linked module (sketch-web-components) from being compiled with CSS Modules option turned on. I fixed it with the following config: module.exports = {
webpack: {
define: config.globals,
rules: {
'sass-pipeline': {
include: path.resolve(__dirname, 'src')
},
'vendor-sass-pipeline': {
include: /sketch-web-components/
},
'sass-css': {
options: {
modules: true
}
},
'sass-postcss': {
plugins: postcssPlugins
},
'vendor-sass-postcss': {
plugins: postcssPlugins
}
}
}
} But I suspect this is some weird issue that happened because I linked the package. |
This issue is a:
Is the version of
nwb
you're using installed globally or locally?Locally
Which versions of Node.js, npm and nwb are you using (if using it globally)?
v7.4.0
I'm not quite sure if this is a bug, but in the configuration documentation you mention the following:
I implied that that meant that you could change include and exclude for a loader, like so:
This is the result in the Webpack config:
And that results in an error (
WebpackOptionsValidationError
). I assumed it would have changed the exlude configuration on the bottom.Is it possible to change include/exclude in another way?
The text was updated successfully, but these errors were encountered: