babel-preset-es2015-rollup-vue
raw JSON → 1.1.0 verified Sat Apr 25 auth: no javascript deprecated
A Babel preset tailored for building Vue.js source code with Rollup. It is based on babel-preset-es2015-rollup but excludes the ES6 symbol typeof transform to avoid issues with Rollup's tree-shaking. Version 1.1.0 is the current stable release. This preset is deprecated and should not be used for new projects; use @babel/preset-env instead.
Common errors
error Error: Plugin/Preset files are not allowed to export objects, only functions. ↓
cause The preset may be incorrectly loaded or the module format is outdated.
fix
Ensure you are using a compatible version of Babel (e.g., Babel 6). This preset is for Babel 6.
error Module not found: Error: Can't resolve 'babel-preset-es2015-rollup-vue' ↓
cause The preset is not installed.
fix
Run 'npm install babel-preset-es2015-rollup-vue' or remove it from .babelrc.
Warnings
deprecated This preset is deprecated and no longer maintained. Use @babel/preset-env instead. ↓
fix Replace with @babel/preset-env and configure targets.
gotcha This preset is specifically for Vue.js source building with Rollup. It may not work for other projects or setups. ↓
fix Use a general-purpose preset like @babel/preset-env for most projects.
breaking Dependency babel-preset-es2015-rollup might have breaking changes that affect this preset. ↓
fix Check the base preset for updates or switch to @babel/preset-env.
Install
npm install babel-preset-es2015-rollup-vue yarn add babel-preset-es2015-rollup-vue pnpm add babel-preset-es2015-rollup-vue Imports
- default wrong
const preset = require('babel-preset-es2015-rollup-vue')correctimport preset from 'babel-preset-es2015-rollup-vue'
Quickstart
// .babelrc
{
"presets": ["babel-preset-es2015-rollup-vue"]
}
// or in rollup.config.js with rollup-plugin-babel
import babel from 'rollup-plugin-babel';
export default {
plugins: [
babel({
presets: ['babel-preset-es2015-rollup-vue']
})
]
};