Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !9374

fix: use default modules option from `preset-env`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/JLHwung/use-default-preset-env-modules into master Jul 27, 2020
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: JLHwung

This PR removes modules: false option and resorts to the defaults of @babel/preset-env: { modules: "auto" }.

See https://github.com/babel/website/pull/2301 for the differences between { modules: "auto" } and { modules: false }.

Since Babel 7.11 (https://github.com/babel/babel/pull/11849), { modules: false } could result to unwanted behaviour when export * as ns is used in test environment on Node 14, where Babel will skip proposal-export-ns-from because Node 14 has native export * as ns support but Webpack 4 will throw because it does not support export * as ns.

When { modules: "auto" } is specified, Babel will determine whether it should be transformed from the caller data passed by babel-loader.

This change is not breaking change given that webpack 4 + babel-loader 8 used in CRA yields same results between modules: "auto" and modules: false.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/JLHwung/use-default-preset-env-modules