-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
feat(webpack): add webpack:config
hook
#6350
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6350 +/- ##
==========================================
+ Coverage 95.71% 95.72% +<.01%
==========================================
Files 79 79
Lines 2662 2665 +3
Branches 685 685
==========================================
+ Hits 2548 2551 +3
Misses 98 98
Partials 16 16
Continue to review full report at Codecov.
|
packages/webpack/src/builder.js
Outdated
@@ -57,6 +57,10 @@ export class WebpackBundler { | |||
webpackConfigs.push(this.getWebpackConfig('Server')) | |||
} | |||
|
|||
const additionalConfigs = [] | |||
await this.buildContext.nuxt.callHook('build:config', additionalConfigs) |
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.
Why not just pass webpackConfigs? And also a ref to the builder?
For hacking purposes it would be interesting to just have access to everything.
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.
We've already provided extend
for customising, I'm wondering it we should expose here again.
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.
Probably we can use this hook to implement extend
directly
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 added webpackConfigs for now, let's see further comments
webpack:config
hook
Types of changes
Description
I didn't add any param for now since we already have extend for customising webpack config and this hook should avoid introducing more side effects.
Checklist: