@vue/babel-preset-app
babel-preset-app for vue-cli
Last updated 5 years ago by soda .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @vue/babel-preset-app 
SYNC missed versions from official npm registry.

@vue/babel-preset-app

This is the default Babel preset used in all Vue CLI projects. Note: this preset is meant to be used exclusively in projects created via Vue CLI and does not consider external use cases.

Included Features

@babel/preset-env

preset-env automatically determines the transforms and polyfills to apply based on your browser target. See Browser Compatibility section in docs for more details.

  • modules: false
    • auto set to 'commonjs' in Jest tests
  • useBuiltIns: 'usage'
  • targets is determined:
    • using browserslist field in package.json when building for browsers
    • set to { node: 'current' } when running unit tests in Node.js
  • Includes Promise polyfill by default so that they are usable even in non-transpiled dependencies (only for environments that need it)

Stage 3 or Below

Only the following stage 3 or below features are supported (object rest spread is supported as part of preset-env):

If you need additional stage 3 or below features, you need to install and configure it yourself.

Vue JSX support

@babel/plugin-transform-runtime

transform-runtime avoids inlining helpers in every file. This is enabled for helpers only, since polyfills are handled by babel-preset-env.

Options

  • All options from @babel/preset-env are supported, with some of them having smarter defaults.

modules

  • Default:
    • false when building with webpack
    • 'commonjs' when running tests in Jest.

Explicitly set modules option for babel-preset-env. See babel-preset-env docs for more details.

targets

  • Default:
    • determined from browserslist field in package.json when building for browsers
    • set to { node: 'current' } when running unit tests in Node.js

Explicitly set targets option for babel-preset-env. See babel-preset-env docs for more details.

useBuiltIns

  • Default: 'usage'
  • Allowed values: 'usage' | 'entry' | false

Explicitly set useBuiltIns option for babel-preset-env.

The default value is 'usage', which adds imports to polyfills based on the usage in transpiled code. For example, if you use Object.assign in your code, the corresponding polyfill will be auto-imported if your target environment does not supports it.

If you are building a library or web component instead of an app, you probably want to set this to false and let the consuming app be responsible for the polyfills.

Note that the usage detection does not apply to your dependencies (which are excluded by cli-plugin-babel by default). If one of your dependencies need polyfills, you have a few options:

  1. If the dependency is written in an ES version that your target environments do not support: Add that dependency to the transpileDependencies option in vue.config.js. This would enable both syntax transforms and usage-based polyfill detection for that dependency.

  2. If the dependency ships ES5 code and explicitly lists the polyfills needed: you can pre-include the needed polyfills using the polyfills option for this preset.

  3. If the dependency ships ES5 code, but uses ES6+ features without explicitly listing polyfill requirements (e.g. Vuetify): Use useBuiltIns: 'entry' and then add import '@babel/polyfill' to your entry file. This will import ALL polyfills based on your browserslist targets so that you don't need to worry about dependency polyfills anymore, but will likely increase your final bundle size with some unused polyfills.

See @babel/preset-env docs for more details.

polyfills

  • Default: ['es6.array.iterator', 'es6.promise', 'es6.object.assign', 'es7.promise.finally']

A list of core-js polyfills to pre-include when using useBuiltIns: 'usage'. These polyfills are automatically excluded if they are not needed for your target environments.

Use this option when you have 3rd party dependencies that are not processed by Babel but have specific polyfill requirements (e.g. Axios and Vuex require Promise support).

jsx

  • Default: true.

Set to false to disable JSX support. Or you can toggle @vue/babel-preset-jsx features here.

loose

  • Default: false.

Setting this to true will generate code that is more performant but less spec-compliant.

entryFiles

  • Default: []

Multi page repo use entryFiles to ensure inject polyfills to all entry file.

Current Tags

  • 5.0.8                                ...           latest (2 years ago)
  • 5.0.6                                ...           next (2 years ago)

158 Versions

  • 5.0.8                                ...           2 years ago
  • 5.0.7                                ...           2 years ago
  • 4.5.19                                ...           2 years ago
  • 5.0.6                                ...           2 years ago
  • 4.5.18                                ...           2 years ago
  • 5.0.5                                ...           2 years ago
  • 4.5.17                                ...           3 years ago
  • 5.0.4                                ...           3 years ago
  • 4.5.16                                ...           3 years ago
  • 5.0.3                                ...           3 years ago
  • 5.0.2                                ...           3 years ago
  • 5.0.1                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 5.0.0-rc.3                                ...           3 years ago
  • 5.0.0-rc.2                                ...           3 years ago
  • 5.0.0-rc.1                                ...           3 years ago
  • 5.0.0-rc.0                                ...           3 years ago
  • 4.5.15                                ...           3 years ago
  • 5.0.0-beta.7                                ...           3 years ago
  • 4.5.14                                ...           3 years ago
  • 5.0.0-beta.6                                ...           3 years ago
  • 5.0.0-beta.5                                ...           3 years ago
  • 5.0.0-beta.4                                ...           3 years ago
  • 5.0.0-beta.3                                ...           3 years ago
  • 5.0.0-beta.2                                ...           3 years ago
  • 5.0.0-beta.1                                ...           4 years ago
  • 4.5.13                                ...           4 years ago
  • 5.0.0-beta.0                                ...           4 years ago
  • 5.0.0-alpha.8                                ...           4 years ago
  • 4.5.12                                ...           4 years ago
  • 5.0.0-alpha.7                                ...           4 years ago
  • 5.0.0-alpha.6                                ...           4 years ago
  • 5.0.0-alpha.5                                ...           4 years ago
  • 5.0.0-alpha.4                                ...           4 years ago
  • 4.5.11                                ...           4 years ago
  • 5.0.0-alpha.3                                ...           4 years ago
  • 5.0.0-alpha.2                                ...           4 years ago
  • 5.0.0-alpha.1                                ...           4 years ago
  • 4.5.10                                ...           4 years ago
  • 5.0.0-alpha.0                                ...           4 years ago
  • 4.5.9                                ...           4 years ago
  • 4.5.8                                ...           4 years ago
  • 4.5.7                                ...           4 years ago
  • 4.5.6                                ...           4 years ago
  • 4.5.5                                ...           4 years ago
  • 4.5.4                                ...           4 years ago
  • 4.5.3                                ...           4 years ago
  • 4.5.2                                ...           4 years ago
  • 4.5.1                                ...           4 years ago
  • 4.5.0                                ...           4 years ago
  • 4.4.6                                ...           4 years ago
  • 4.4.5                                ...           4 years ago
  • 4.4.4                                ...           4 years ago
  • 4.4.3                                ...           4 years ago
  • 4.4.2                                ...           4 years ago
  • 4.4.1                                ...           4 years ago
  • 4.4.0                                ...           4 years ago
  • 4.3.1                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 4.2.3                                ...           5 years ago
  • 4.2.2                                ...           5 years ago
  • 4.2.1                                ...           5 years ago
  • 4.2.0                                ...           5 years ago
  • 4.1.2                                ...           5 years ago
  • 4.1.1                                ...           5 years ago
  • 4.1.0                                ...           5 years ago
  • 4.1.0-beta.0                                ...           5 years ago
  • 4.0.5                                ...           5 years ago
  • 3.12.1                                ...           5 years ago
  • 4.0.4                                ...           5 years ago
  • 4.0.3                                ...           5 years ago
  • 4.0.2                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 4.0.0-rc.8                                ...           5 years ago
  • 3.12.0                                ...           5 years ago
  • 4.0.0-rc.7                                ...           5 years ago
  • 4.0.0-rc.6                                ...           5 years ago
  • 4.0.0-rc.5                                ...           5 years ago
  • 4.0.0-rc.4                                ...           5 years ago
  • 4.0.0-rc.3                                ...           5 years ago
  • 4.0.0-rc.2                                ...           5 years ago
  • 4.0.0-rc.1                                ...           5 years ago
  • 3.11.0                                ...           5 years ago
  • 4.0.0-rc.0                                ...           5 years ago
  • 4.0.0-beta.3                                ...           5 years ago
  • 3.10.0                                ...           5 years ago
  • 4.0.0-beta.2                                ...           5 years ago
  • 4.0.0-beta.1                                ...           5 years ago
  • 4.0.0-beta.0                                ...           5 years ago
  • 4.0.0-alpha.5                                ...           5 years ago
  • 4.0.0-alpha.4                                ...           5 years ago
  • 3.9.2                                ...           5 years ago
  • 4.0.0-alpha.3                                ...           5 years ago
  • 3.9.0                                ...           5 years ago
  • 4.0.0-alpha.2                                ...           5 years ago
  • 3.8.0                                ...           5 years ago
  • 4.0.0-alpha.1                                ...           5 years ago
  • 4.0.0-alpha.0                                ...           6 years ago
  • 3.7.0                                ...           6 years ago
  • 3.6.0                                ...           6 years ago
  • 3.5.5                                ...           6 years ago
  • 3.5.4                                ...           6 years ago
  • 3.5.3                                ...           6 years ago
  • 3.5.2                                ...           6 years ago
  • 3.5.1                                ...           6 years ago
  • 3.5.0                                ...           6 years ago
  • 3.4.1                                ...           6 years ago
  • 3.4.0                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.2.2                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.1.1                                ...           6 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.5                                ...           6 years ago
  • 3.0.4                                ...           6 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 3.0.0-rc.12                                ...           6 years ago
  • 3.0.0-rc.11                                ...           6 years ago
  • 3.0.0-rc.10                                ...           6 years ago
  • 3.0.0-rc.9                                ...           6 years ago
  • 3.0.0-rc.8                                ...           6 years ago
  • 3.0.0-rc.7                                ...           6 years ago
  • 3.0.0-rc.6                                ...           6 years ago
  • 3.0.0-rc.5                                ...           6 years ago
  • 3.0.0-rc.4                                ...           6 years ago
  • 3.0.0-rc.3                                ...           6 years ago
  • 3.0.0-rc.2                                ...           6 years ago
  • 3.0.0-rc.1                                ...           6 years ago
  • 3.0.0-beta.16                                ...           6 years ago
  • 3.0.0-beta.15                                ...           6 years ago
  • 3.0.0-beta.14                                ...           6 years ago
  • 3.0.0-beta.13                                ...           6 years ago
  • 3.0.0-beta.12                                ...           6 years ago
  • 3.0.0-beta.11                                ...           6 years ago
  • 3.0.0-beta.10                                ...           7 years ago
  • 3.0.0-beta.9                                ...           7 years ago
  • 3.0.0-beta.8                                ...           7 years ago
  • 3.0.0-beta.7                                ...           7 years ago
  • 3.0.0-beta.6                                ...           7 years ago
  • 3.0.0-beta.5                                ...           7 years ago
  • 3.0.0-beta.4                                ...           7 years ago
  • 3.0.0-beta.3                                ...           7 years ago
  • 3.0.0-beta.2                                ...           7 years ago
  • 3.0.0-beta.1                                ...           7 years ago
  • 3.0.0-alpha.13                                ...           7 years ago
  • 3.0.0-alpha.12                                ...           7 years ago
  • 3.0.0-alpha.11                                ...           7 years ago
  • 3.0.0-alpha.10                                ...           7 years ago
  • 3.0.0-alpha.9                                ...           7 years ago
  • 3.0.0-alpha.8                                ...           7 years ago
  • 3.0.0-alpha.7                                ...           7 years ago
  • 3.0.0-alpha.6                                ...           7 years ago
  • 3.0.0-alpha.5                                ...           7 years ago
  • 3.0.0-alpha.4                                ...           7 years ago
  • 3.0.0-alpha.3                                ...           7 years ago
  • 3.0.0-alpha.2                                ...           7 years ago
  • 3.0.0-alpha.1                                ...           7 years ago
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE