Babel
Transpile JS files with Babel.
Install
Install the plugin and its dependencies:
npm i magefront-plugin-babel @babel/core --save-dev
Usage
import babel from 'magefront-plugin-babel'
export default {
plugins: [
babel({ src: 'js/source/**/*.js' })
]
}
Options
src
⭐
The source files to transform.
This is not targeted to all the .js
files by default because the Magento 2 JS files are kind of messy.
If you want to still give it a go, you can use src: '**/*.js'
.
ignore
A list of paths to ignore.
compilerOptions
Options to pass to the babel compiler.
⭐ - Required option