-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Adds support for preLoaders in custom webpack config #107
Conversation
@@ -56,6 +56,9 @@ export default function (baseConfig, configDir) { | |||
module: { | |||
...config.module, | |||
// We need to use our and custom loaders. | |||
preLoaders: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there's a much better generic way to deal with this.
Try this instead of this one. I hope it'll work.
...customConfig.module || {},
If this works, send me a PR with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need on each loader, because if we default to empty object it won't use default config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this won't work, if we do it ^ this way and customConfig.module
contains loader
it will override loader
in config.module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Did you try that, it's add loaders but in the line 62 it'll get override again with the our own loaders?
If that's not working, I'll take this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see. Sorry I misunderstood, I thought you meant remove whole loaders: []
block too. But this works nicely. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome.
…Support for postLoaders
This is great. Thanks. |
Released with |
* Adds support for preLoaders in custom webpack config * Changes the way it loads custom webpacck config to more generic way. Support for postLoaders
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2005b27. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Fixes #90
Adds support for preLoaders to be added to custom webpack config. This allows you to use preLoaders that need to be run before loaders, like code linting, hinting etc.
Was considering adding support for postLoaders too, but I don't have any experience with them so will leave it for now.