webpack-cli
webpack-cli copied to clipboard
feat: next
What kind of change does this PR introduce?
Breaking changes.
Did you add tests for your changes? Yes.
If relevant, did you update the documentation? Yes.
Summary
Prepare for the next major release.
Does this PR introduce a breaking change? Yes.
Other information
- [x] drop node v10, v12
- [x] drop webpack v4
- [x] drop webpack-dev-server v3
- [x] remove
--prefetch
- [x] remove
--hot
- [x] remove
migrate
command - [ ] update all deps to the latest
- [x] --entry require --entry-reset before (need add test(s)) https://github.com/webpack/webpack-cli/pull/3372
- [x] --target require --target-reset before (need add test(s)) https://github.com/webpack/webpack-cli/pull/3347
- [x] refactor build tests - avoid using scripts/prepareSuite.js and put all deps in top package.json + rename tests https://github.com/webpack/webpack-cli/pull/3409
- [ ] node-env should be renamed?
- [ ] simplify logic for
getBuiltInOptions
and remove extra map/reduce/etc and avoid using builtInOptionsCache - [ ] make stable CLI API for public usage
- [ ] avoid unnecessary process.exit()
- [ ] resolve TODOs wherever possible.
- [x] remove the webpack version in favor of webpack info (https://github.com/webpack/webpack-cli/pull/3370)
Let's keep it open untill all the breaking changes are merged to the next branch.
Codecov Report
Merging #3279 (9caa048) into master (81471b9) will increase coverage by
6.13%
. The diff coverage is87.66%
.
Additional details and impacted files
@@ Coverage Diff @@
## master #3279 +/- ##
==========================================
+ Coverage 85.17% 91.30% +6.13%
==========================================
Files 23 22 -1
Lines 1733 1588 -145
Branches 519 447 -72
==========================================
- Hits 1476 1450 -26
+ Misses 257 138 -119
Impacted Files | Coverage Δ | |
---|---|---|
...s/generators/init-template/default/package.json.js | 100.00% <ø> (ø) |
|
packages/webpack-cli/src/plugins/CLIPlugin.ts | 100.00% <ø> (+1.47%) |
:arrow_up: |
packages/serve/src/index.ts | 78.94% <59.45%> (+17.86%) |
:arrow_up: |
packages/webpack-cli/src/webpack-cli.ts | 92.70% <96.42%> (+1.19%) |
:arrow_up: |
packages/configtest/src/index.ts | 96.00% <100.00%> (+3.40%) |
:arrow_up: |
packages/generators/src/addon-generator.ts | 92.98% <100.00%> (+0.25%) |
:arrow_up: |
packages/generators/src/handlers/default.ts | 98.76% <100.00%> (+43.20%) |
:arrow_up: |
packages/generators/src/init-generator.ts | 85.29% <100.00%> (-7.21%) |
:arrow_down: |
packages/info/src/index.ts | 100.00% <100.00%> (ø) |
|
... and 8 more |
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 81471b9...9caa048. Read the comment docs.
Any status update on this?
@rishabh3112 I've added a the task list in the PR description.
@snitin315 Some things can be postponed, like:
- simplify logic for getBuiltInOptions and remove extra map/reduce/etc and avoid using builtInOptionsCache
- avoid unnecessary process.exit()
- resolve TODOs wherever possible.
- resolve TODOs wherever possible.
We should look at code, if we will not have breaking change, we can postpone it and solve late, I think we should do release soon, because we need to drop nodev12 for webpack-dev-server too
Maybe we can collect them here and decide it
@alexander-akait yes, I feel the tasks left won't be breaking changes. We are mostly done with all the breaking changes.
node-env should be renamed?
Was any issue raised for this? Do you have any other name in mind? I feel node-env
name is ok.
hm, give me time to undestand why do we even need this
@alexander-akait This was requested from users in https://github.com/webpack/webpack-cli/issues/2362
@snitin315 Oh, I wanted to rename node-env
, because it is confising, many developers using node-env
think that it will change process.env.NODE_ENV
inside webpack.config.js
, but it only change process.env.NODE_ENV
in code, that is why I think we need another name for this. What do you think?
@alexander-akait In that case it makes sense to update the name, we can also mention this explicitly in docs.
How about --runtime-node-env
?
What about --define-node-env
? Ideally will be great to have something like --define:process.env.NODE_ENV='production'
, so developer can add more things, but not sure our args parser can do it, need to test
--define:process.env.NODE_ENV
How about --define-process-node-env
/--define-process-env-node-env
--define-process-env-node-env
looks good for me, in future we can implement --define-*
supporing for more options
@snitin315 Regarding
update all deps to the latest
What is left?
@snitin315 Regarding
update all deps to the latest
What is left?
@alexander-akait Only updating commander.js to v9 is left.
@snitin315 Great, feel free to ask help if you will have problems with it
[ ] make stable CLI API for public usage
@alexander-akait What do we want to change in the API?
@snitin315 Can you show me where you take this task? I need context to remeber it :smile:
@alexander-akait This was in old next https://github.com/webpack/webpack-cli/pull/2879
@snitin315 Got it, I mean we should add tests cases where developer programatically run WebppackCLI
and can run build
/serve
/etc commands without problems
Maybe we can postpone it too then.
@snitin315 Yeah, I think soo, anything else we need to finish before merge and release? Maybe ESM?
Yes. Only ESM is left.
Great, thank you
@alexander-akait I feel we can merge this after CI is green. We should do Rebase and Merge
to preserve commit history.

@snitin315 Yeah, we should not lose changelog generation :+1:
@alexander-akait We can release it now 👍🏻
@alexander-akait I feel we can merge 👍🏻