|
1 | 1 | # @vue/babel-preset-app
|
2 | 2 |
|
3 |
| -> babel-preset-app for vue-cli |
| 3 | +This is the default Babel preset used in all Vue CLI projects. |
| 4 | + |
| 5 | +## Included |
| 6 | + |
| 7 | +- [babel-preset-env](https://github.com/babel/babel/tree/master/packages/babel-preset-env) |
| 8 | + - `modules: false` |
| 9 | + - auto set to `'commonjs'` in Jest tests |
| 10 | + - [`useBuiltIns: 'usage'`](https://github.com/babel/babel/tree/master/packages/babel-preset-env#usebuiltins-usage) |
| 11 | + - ensures polyfills are imported on-demand |
| 12 | + - `targets` is determined: |
| 13 | + - using `browserslist` field in `package.json` when building for browsers |
| 14 | + - set to `{ node: 'current' }` when running unit tests in Node.js |
| 15 | +- [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime) |
| 16 | + - Only enabled for helpers since polyfills are handled by `babel-preset-env` |
| 17 | +- [dynamic import syntax](https://github.com/tc39/proposal-dynamic-import) |
| 18 | +- [Object rest spread](https://github.com/tc39/proposal-object-rest-spread) |
| 19 | +- [babel-preset-stage-2](https://github.com/babel/babel/tree/master/packages/babel-preset-stage-2) |
| 20 | +- Vue JSX support |
| 21 | + - [@babel/plugin-syntax-jsx](https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx) |
| 22 | + - [babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx) |
| 23 | + - [babel-plugin-jsx-event-modifiers](https://github.com/nickmessing/babel-plugin-jsx-event-modifiers) |
| 24 | + - [babel-plugin-jsx-v-model](https://github.com/nickmessing/babel-plugin-jsx-v-model) |
| 25 | + |
| 26 | +## Options |
| 27 | + |
| 28 | +- **modules** |
| 29 | + |
| 30 | + Default: |
| 31 | + - `false` when building with webpack |
| 32 | + - `'commonjs'` when running tests in Jest. |
| 33 | + |
| 34 | + Explicitly set `modules` option for `babel-preset-env`. |
| 35 | + |
| 36 | +- **targets** |
| 37 | + |
| 38 | + Default: |
| 39 | + - determined from `browserslist` field in `package.json` when building for browsers |
| 40 | + - set to `{ node: 'current' }` when running unit tests in Node.js |
| 41 | + |
| 42 | + Explicitly set `targets` option for `babel-preset-env`. |
| 43 | + |
| 44 | +- **jsx** |
| 45 | + |
| 46 | + Default: `true`. Set to `false` to disable JSX support. |
0 commit comments