Issue #752
Use esm
js
npm install esmIn our code, import as normal
js
const fs = require('fs');
// intended to be run after babel, and in ./dist folder
import factory from 'data'
const shell = require('shelljs')Then use esm to convert
js
{
"name": "generator",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "npx babel index.js --out-file dist/index.js && node -r esm dist/index.js"
}
}
Start the conversation