Please tell me how to configure babel so that only import? can be converted.

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 ?

Apr.14,2021

use babel-preset-env, and then target: node should be fine.

  https://babeljs.io/docs/en/en.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b330af-2b6b4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b330af-2b6b4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?