because it is customary to use import to import and export modules before writing frontend. After all, there is babel . Writing nodejs also continues this habit. Anyway, it all needs to be converted to es5
"scripts": {
"start": "nodemon src/app.js --exec babel-node --presets es2015,stage-2",
"build": "babel src -d dist --presets es2015,stage-2",
"serve": "node dist/app.js",
but I learned today that converting to es5 on the node side actually sacrifices a lot of efficiency. Because nodejs is up-to-date and all grammars are natively supported, except import , how can babel be configured to convert only import to require ?
