mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-06 15:08:27 -06:00
@vue/babel-preset-app
This is the default Babel preset used in all Vue CLI projects.
Included
- babel-preset-env
modules: false- auto set to
'commonjs'in Jest tests
- auto set to
useBuiltIns: 'usage'- ensures polyfills are imported on-demand
targetsis determined:- using
browserslistfield inpackage.jsonwhen building for browsers - set to
{ node: 'current' }when running unit tests in Node.js
- using
- @babel/plugin-transform-runtime
- Only enabled for helpers since polyfills are handled by
babel-preset-env
- Only enabled for helpers since polyfills are handled by
- dynamic import syntax
- Object rest spread
- babel-preset-stage-2
- Vue JSX support
- @babel/plugin-syntax-jsx
- babel-plugin-transform-vue-jsx
babel-plugin-jsx-event-modifiers(temporarily disabled until fixed for Babel 7)babel-plugin-jsx-v-model(temporarily disabled until fixed for Babel 7)
Options
-
modules
Default:
falsewhen building with webpack'commonjs'when running tests in Jest.
Explicitly set
modulesoption forbabel-preset-env. See babel-preset-env docs for more details. -
targets
Default:
- determined from
browserslistfield inpackage.jsonwhen building for browsers - set to
{ node: 'current' }when running unit tests in Node.js
Explicitly set
targetsoption forbabel-preset-env. See babel-preset-env docs for more details. - determined from
-
useBuiltIns
Default:
'usage'Explicitly set
useBuiltInsoption forbabel-preset-env. See babel-preset-env docs for more details. -
jsx
Default:
true. Set tofalseto disable JSX support.