NPM Install Babel-cli-g//Installing BabelBabel Index.js-O A.js//equivalent to Babel index.js--out-file a.js copy index.js to A.jsBabel src/-D build///equivalent to Babel src/--out-dir build/Copy all files under the SRC directory into the build directory//------------------------------//The Babel command is placed in the Pageage for easy invocationPackage.json ="Scripts": { "Test":"echo \ "Error:no test specified\" && exit 1", "Build":"Babel src/-D build/"//equivalent to Babel src/--out-dir build/Copy all files under the SRC directory into the build directory},NPM Run Build//------------------------------NPM Install babel-preset-es2015--save-dev//Note: It is important to use the "Local installation" to install the error when the conversion is installed Babel converter es6-es5Touch. BABELRC =//setting up a. BABELRC configuration file { "Presets":["es2015"]}NPM Run Build//once configured, running the-d command will convert ES6 to ES5
Node ES6 Babel Study notes