Skip to content
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

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

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 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 added 2 commits Sep 3, 2019
@clarkdo clarkdo requested a review from nuxt/core-team Sep 3, 2019
@codecov-io

This comment has been minimized.

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

This comment has been minimized.

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)

This comment has been minimized.

Copy link
@pimlie

pimlie Sep 3, 2019

Member

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.

This comment has been minimized.

Copy link
@clarkdo

clarkdo Sep 3, 2019

Author Member

We've already provided extend for customising, I'm wondering it we should expose here again.

This comment has been minimized.

Copy link
@clarkdo

clarkdo Sep 3, 2019

Author Member

Probably we can use this hook to implement extend directly

This comment has been minimized.

Copy link
@clarkdo

clarkdo Sep 3, 2019

Author Member

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
@manniL manniL changed the title feat: add hook webapck:config feat: add hook webpack:config Sep 3, 2019
@pi0
pi0 approved these changes Sep 3, 2019
@pi0 pi0 changed the title feat: add hook webpack:config feat(webpack): add `webpack:config` hook Sep 3, 2019
@pi0 pi0 merged commit f6ca2c7 into dev Sep 3, 2019
9 checks passed
9 checks passed
Semantic Pull Request ready to be squashed
Details
[ci.azure] nuxt.js #20190903.17 succeeded
Details
ci/circleci: audit Your tests passed on CircleCI!
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: lint-app Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test-e2e Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details
@pi0 pi0 deleted the feat/build-config-hook branch Sep 3, 2019
@pi0 pi0 mentioned this pull request Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.