Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Use native ESM for dev scripts #12137
Comments
|
Note that we should also bump building requirements to We can also update gulp to 4.2.0 which supports |
|
I would like to work on this |
|
Can i have a go? |
|
Uh... I'm assigning this to @karansapolia since he claimed this issue first, but if you two want to split the work in two parts (maybe the two points I wrote in the issue description? The second one is probably easier) please discuss about it |
|
Thats okay @karansapolia Go for it! |
Renaming Either we should not include Currently, after following the recommendations in the issue description and putting |
|
Oh that's unfortunate |
I don't think so. gulpjs/gulp-cli@c9e9125 ships in |
|
@karansapolia I see you pushed some commits! |
|
@nicolo-ribaudo Yes, I was stuck on an error. Could use some help definitely. Let me create a draft PR so all can have a look. |


Since we are now only building Babel on Node.js 14 (even if we still test it on Node.js 6), we can use native ECMAScript modules for the build scripts:
Top-level scripts
There are a bunch of scripts/tests in the
scriptsfolder: they can probably all be rewritten to ES modules.We can probably add
"type": "module"to the top-levelpackage.json, renaming config files (such as.eslintrc.js) to.cjs. Note that we cannot use ES modules forbabel.config.jsandjest.config.js, because those two files are used to run tests on Node.js 6.babel-types/scriptscan be rewritten to ES modules. These files should be renamed to.mjs, to keep the dist@babel/typesfiles with the.jsextension (they are CJS modules).Please note that
babel-types/scriptsdepends on the top-level scripts, sobabel-types/scriptsmust be converted first (it cannot synchronously import an ESM file while still being CJS).In order to test if your changes are still ok, running
yarn(only when you clone the repo) andmake build && yarn jestshould be enough.