Skip to content

Commit

Permalink
docs: mention plugin in migration guide + typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 25, 2018
1 parent 1bbb4bc commit 949ba66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Vue CLI

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.
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.

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.

Expand Down
24 changes: 20 additions & 4 deletions docs/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,30 @@ sidebarDepth: 2
# Migrating from v14

::: tip Heads Up
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.
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.
:::

## Notable Breaking Changes

### A Plugin is Now Required

Vue Loader 15 now requires an accompanying webpack plugin to function properly:

``` js
// webpack.config.js
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
// ...
plugins: [
new VueLoaderPlugin()
]
}
```

### Loader Inference

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

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.

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

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.
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.

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

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

### PostCSS

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

### CSS Modules

Expand Down

0 comments on commit 949ba66

Please sign in to comment.