Answers for "babel"

6

install babel command line

npm i -D @babel/core @babel/preset-env babel-loader
Posted by: Guest on May-12-2020
2

babel cmd

babel src\app.js --out-file=public\scripts\app.js --presets=env,react --watch
Posted by: Guest on September-10-2020
6

babel

<!-- v6 <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Your custom script here -->
<script type="text/babel">
Posted by: Guest on July-20-2020
0

babel

// yarn add @babel/cli @babel/core @babel/node @babel/plugin-transform-runtime @babel/preset-env --dev
// yarn add @babel/runtime 
"dependencies": {
    "@babel/runtime": "^7.15.4" //a package to be installed production dependency to avoid duplication across your compiled output.
  },
  "devDependencies": {
    "@babel/cli": "^7.15.7", // A built-in CLI which can be used to compile files from the command line/terminal.
    "@babel/core": "^7.15.5", // a fundamental package to run any babel setup/configuration
    "@babel/node": "^7.15.4", //babel-node is a CLI that works the same as the Node.js CLI, with the added benefit of compiling with Babel presets and plugins before running it.
    "@babel/plugin-transform-runtime": "^7.15.0", // A plugin that enables the re-use of Babel's injected helper code to save on code size.
    "@babel/preset-env": "^7.15.6" //  is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, browser polyfills) are needed by your target environment(s).
  }

// package.json
"scripts": {
    "start": "yarn run build && node ./build/src/app.js",
    "start:dev": "babel-node ./src/app.js",
    "clean": "rm -rf build && mkdir build",
    "build-babel": "babel ./src -d ./build/src",
    "build": "yarn run clean && yarn run build-babel"
}

// .babelrc
{
  "presets": ["@babel/preset-env"],
  "plugins": [
    ["@babel/plugin-transform-runtime"]
  ]
}
Posted by: Guest on October-03-2021
0

babel

npm install --save-dev @babel/core @babel/cli
Copy
Posted by: Guest on February-24-2021
0

What is Babel?

javascript compiler
Posted by: Guest on September-21-2021

Browse Popular Code Answers by Language