Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update Babel and rename babel.config.js to babel.config.cjs #6061

@aldeed

Description

@aldeed

The following is logged whenever Babel is involved (running tests mostly):

(node:39890) Warning: require() of ES modules is not supported.require() of babel.config.js from node_modules/@babel/core/lib/config/files/configuration.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which de
fines all .js files in that package scope as ES modules.Instead rename babel.config.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from package.json.

Babel 7.7.0 adds support for .cjs extension: https://github.com/babel/babel/blob/master/CHANGELOG.md#v770-2019-11-05

So the tasks:

  • Update Babel and all related packages to 7.7.0, or as high as we can go without breaking things
  • Rename babel.config.js -> babel.config.cjs to avoid this warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions