Skip to content

Commit 949ba66

Browse files
committed
docs: mention plugin in migration guide + typo fix
1 parent 1bbb4bc commit 949ba66

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

Diff for: docs/guide/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Vue CLI
44

5-
If you are not interested in manually setting up webpack, it is recommended to scaffold a project with [Vue CLI](https://github.com/vuejs/vue-cli) instead. Projects created by Vue CLI is pre-configured with most of the common development needs and works out of the box.
5+
If you are not interested in manually setting up webpack, it is recommended to scaffold a project with [Vue CLI](https://github.com/vuejs/vue-cli) instead. Projects created by Vue CLI are pre-configured with most of the common development needs working out of the box.
66

77
Follow this guide if the built-in configuration of Vue CLI does not suit your needs, or you'd rather create your own webpack config from scratch.
88

Diff for: docs/migrating.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,30 @@ sidebarDepth: 2
66
# Migrating from v14
77

88
::: tip Heads Up
9-
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue Loader v15, so you might want to wait if are planning to upgrade to Vue CLI 3.
9+
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue Loader 15, so you might want to wait if you are planning to upgrade to Vue CLI 3.
1010
:::
1111

1212
## Notable Breaking Changes
1313

14+
### A Plugin is Now Required
15+
16+
Vue Loader 15 now requires an accompanying webpack plugin to function properly:
17+
18+
``` js
19+
// webpack.config.js
20+
const { VueLoaderPlugin } = require('vue-loader')
21+
22+
module.exports = {
23+
// ...
24+
plugins: [
25+
new VueLoaderPlugin()
26+
]
27+
}
28+
```
29+
1430
### Loader Inference
1531

16-
`vue-loader` 15 now infers loaders to use for language blocks a bit differently.
32+
Vue Loader 15 now uses a different strategy to infer loaders to use for language blocks.
1733

1834
Take `<style lang="less">` as an example: in v14 and below, it will attempt to load the block with `less-loader`, and implicitly chains `css-loader` and `vue-style-loader` after it, all using inline loader strings.
1935

@@ -37,7 +53,7 @@ In v15, `<style lang="less">` will behave as if it's an actual `*.less` file bei
3753
}
3854
```
3955

40-
The benefit is that this same rule also applies to plain `*.less` imports from JavaScript, and you can configure options for these loaders anyway you want. In v14 and below, if you want to provide custom options to an inferred loader, you'd have to duplicate it under `vue-loader`'s own `loaders` option. In v15 it is no longer necessary.
56+
The benefit is that this same rule also applies to plain `*.less` imports from JavaScript, and you can configure options for these loaders anyway you want. In v14 and below, if you want to provide custom options to an inferred loader, you'd have to duplicate it under Vue Loader's own `loaders` option. In v15 it is no longer necessary.
4157

4258
v15 also allows using non-serializable options for loaders, which was not possible in previous versions.
4359

@@ -93,7 +109,7 @@ Note the injection order is still not guaranteed, so you should avoid writing CS
93109

94110
### PostCSS
95111

96-
`vue-loader` no longer auto applies PostCSS transforms. To use PostCSS, configure `postcss-loader` the same way you would for normal CSS files.
112+
Vue Loader no longer auto applies PostCSS transforms. To use PostCSS, configure `postcss-loader` the same way you would for normal CSS files.
97113

98114
### CSS Modules
99115

0 commit comments

Comments
 (0)