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

Skip to content

Conversation

@trojanh
Copy link
Contributor

@trojanh trojanh commented Jan 30, 2020

Signed-off-by: trojanh [email protected]

Resolves #6061
Impact: minor
Type: chore

Issue

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.

Solution

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

Breaking changes

none

Testing

Run the tests and verify if the warning is gone,

@aldeed aldeed merged commit b59299c into reactioncommerce:release-3.0.0 Jan 31, 2020
@aldeed
Copy link
Contributor

aldeed commented Jan 31, 2020

Thanks for doing this one @trojanh !

@kieckhafer kieckhafer mentioned this pull request Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants