Last active
April 22, 2020 21:29
-
-
Save markodayan/36e044ca08386b6bae0e8979de7c333d to your computer and use it in GitHub Desktop.
Babel and Modern JS Builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["@babel/preset-env"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i @babel/core @babel/cli -D | |
# babel preset (a set of plugins which are used to support certain language features) [so can use latest JS Features] | |
npm i @babel/preset-env -D | |
#then create file in root called .babelrc and add JSON with "presets" : ["@babel/preset-env"] | |
# compiling a js file into a browser compatible js file | |
node_modules/.bin/babel before.js -o after.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment