npm install babel-cli -g
Install locally
npm install babel-cli --save-dev
Install Babel Preset ES2015
npm install babel-preset-es2015 --save-dev
Transpile all files inside a specific folder:
babel [source-folder] --presets es2015 --out-dir [build-folder]
Transpile and bundle all files inside a specific folder:
babel [source] --presets es2015 --out-file [build/bundle.js]
Transpiling with watch option:
babel [source] --presets es2015 --out-file [build/bundle.js] -w
Configuration with .babelrc
{ "presets": ["es2015"], "plugins": [], "sourceMaps": true }
Không có nhận xét nào :
Đăng nhận xét