Skip to content

Commit 4573897

Browse files
committed
docs: update webpack-4 migrate instructions [skip ci]
1 parent 2814c42 commit 4573897

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

docs/migrations/migrate-from-v4.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,19 @@ Besides the internal changes that are only noticeable for custom configurations,
5858

5959
#### Opt Out to Webpack 4
6060

61-
Considering many ecosystem packages haven't catched up yet, we provided a way to opt out to webpack 4 for easier migration.
61+
Considering many ecosystem packages haven't catched up yet, we provided a plugin to opt out to webpack 4 for easier migration.
6262

63-
If you are using Yarn or PNPM 5.10+, you can specify the `"resolutions"` field in your `package.json`:
63+
It's as simple as running
6464

65-
```json
66-
{
67-
"resolutions": {
68-
"@vue/cli-*/webpack": "^4.44.2"
69-
}
70-
}
65+
```sh
66+
vue add webpack-4
7167
```
7268

73-
and then rerun `yarn` or `pnpm install` to force Vue CLI to use webpack 4.
69+
at the project root.
7470

75-
If you are using NPM, you can simply add webpack 4 to the project's `devDependencies`: `npm i -D webpack@4`. Vue CLI will redirect all the underlying requests to webpack to this version through [`module-alias`](https://github.com/ilearnio/module-alias).
71+
Underlyingly, it uses the [`resolutions`](https://classic.yarnpkg.com/en/docs/selective-version-resolutions) field for Yarn and PNPM users, and [`module-alias`](https://github.com/ilearnio/module-alias) for NPM users.
7672

77-
Though it works in all our tests, please be aware that this approach is still somehow hacky and may not be as stable as the `"resolutions"` approach.
73+
Though both work in all our tests, please be aware that the `module-alias` approach is still considered hacky, and may not be as stable as the `"resolutions"` one.
7874

7975
#### Underlying Loaders and Plugins
8076

0 commit comments

Comments
 (0)