refactor(template): convert the default template from CMJs to esm#4709
refactor(template): convert the default template from CMJs to esm#4709ThierryRakotomanana wants to merge 2 commits intowebpack:mainfrom
Conversation
|
alexander-akait
left a comment
There was a problem hiding this comment.
You need to update all test cases, not just change it in template
|
@alexander-akait test cases updated |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4709 +/- ##
=======================================
Coverage 91.43% 91.43%
=======================================
Files 14 14
Lines 4716 4716
Branches 679 679
=======================================
Hits 4312 4312
Misses 402 402
Partials 2 2 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
alexander-akait
left a comment
There was a problem hiding this comment.
Let's covert all templates in init, not only default, because we recommend to use ECMA modules everywhere
Summary
Currently, the official Getting Started using quick start minimal uses ES Modules (ESM) syntax. However, the command npx create-webpack-app still generates a webpack.config.js using CommonJS (require/module.exports). This creates a confusing experience for new users.
This PR rectifies webpack.config.js tempate to generate an ES Modules config by default.
What kind of change does this PR introduce?
It's refactor, I refactor the default config template
Did you add tests for your changes?
I've updated all test cases,
Does this PR introduce a breaking change?
Not really, just an update
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Use of AI
No need,