8000 Move core plugins docs to documentation website by NataliaTepluhina · Pull Request #4120 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

Move core plugins docs to documentation website #4120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: moved Babel plugin doc
  • Loading branch information
NataliaTepluhina committed Jun 10, 2019
commit c098201502f8056a62ffe88c2a03f127e195c418
3 changes: 2 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
8000 Expand Up @@ -140,7 +140,8 @@ module.exports = {
}
],
'/core-plugins/': [
'/core-plugins/pwa.md'
'/core-plugins/pwa.md',
'/core-plugins/babel.md'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion docs/core-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vue CLI uses a plugin-based architecture. If you inspect a newly created project

This section contains documentation for core Vue CLI plugins:

- Babel
- [Babel](babel.md)
- TypeScript
- ESLint
- [PWA](pwa.md)
Expand Down
39 changes: 39 additions & 0 deletions docs/core-plugins/babel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# @vue/cli-plugin-babel

> Babel plugin for Vue CLI

## Configuration

Uses Babel 7 + `babel-loader` + [@vue/babel-preset-app](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app) by default, but can be configured via `babel.config.js` to use any other Babel presets or plugins.

By default, `babel-loader` excludes files inside `node_modules` dependencies. If you wish to explicitly transpile a dependency module, you will need to add it to the `transpileDependencies` option in `vue.config.js`:

``` js
module.exports = {
transpileDependencies: [
// can be string or regex
'my-dep',
/other-dep/
]
}
```

## Caching

[cache-loader](https://github.com/webpack-contrib/cache-loader) is enabled by default and cache is stored in `<projectRoot>/node_modules/.cache/babel-loader`.

## Parallelization

[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.

## Installing in an Already Created Project

``` sh
vue add @vue/babel
```

## Injected webpack-chain Rules

- `config.rule('js')`
- `config.rule('js').use('babel-loader')`
- `config.rule('js').use('cache-loader')`
0