You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Vue CLI
4
4
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.
6
6
7
7
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.
Copy file name to clipboardExpand all lines: docs/migrating.md
+20-4
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,30 @@ sidebarDepth: 2
6
6
# Migrating from v14
7
7
8
8
::: 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.
10
10
:::
11
11
12
12
## Notable Breaking Changes
13
13
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
+
newVueLoaderPlugin()
26
+
]
27
+
}
28
+
```
29
+
14
30
### Loader Inference
15
31
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.
17
33
18
34
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.
19
35
@@ -37,7 +53,7 @@ In v15, `<style lang="less">` will behave as if it's an actual `*.less` file bei
37
53
}
38
54
```
39
55
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.
41
57
42
58
v15 also allows using non-serializable options for loaders, which was not possible in previous versions.
43
59
@@ -93,7 +109,7 @@ Note the injection order is still not guaranteed, so you should avoid writing CS
93
109
94
110
### PostCSS
95
111
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.
0 commit comments