Skip to content

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

Merged
merged 3 commits into from
Sep 3, 2019
Merged

feat(webpack): add webpack:config hook #6350

merged 3 commits into from
Sep 3, 2019

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Sep 3, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

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:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@clarkdo clarkdo requested a review from a team September 3, 2019 18:16
@codecov-io
Copy link

codecov-io commented Sep 3, 2019

Codecov Report

Merging #6350 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#e2e 100% <ø> (ø) ⬆️
#fixtures 50.73% <100%> (+0.05%) ⬆️
#unit 92.38% <100%> (ø) ⬆️
Impacted Files Coverage Δ
packages/webpack/src/builder.js 93% <100%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1edd82...f79fb71. Read the comment docs.

@clarkdo
Copy link
Member Author

clarkdo commented Sep 3, 2019

@manniL I see, from @pi0 comment, the hook should be corresponding to package, so this should be webpack instead of builder ?

I changed it to webpack:config for now.

@@ -57,6 +57,10 @@ export class WebpackBundler {
webpackConfigs.push(this.getWebpackConfig('Server'))
}

const additionalConfigs = []
await this.buildContext.nuxt.callHook('build:config', additionalConfigs)
Copy link

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.

Copy link
Member Author

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.

Copy link
Member Author

@clarkdo clarkdo Sep 3, 2019

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

Copy link
Member Author

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

@clarkdo clarkdo changed the title feat: add hook build:config feat: add hook webapck:config Sep 3, 2019
@TheAlexLichter TheAlexLichter changed the title feat: add hook webapck:config feat: add hook webpack:config Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants