Skip to content

Commit 27c4bc3

Browse files
committed
docs: basic instructions on modifying webpack config
1 parent 4fb4e35 commit 27c4bc3

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,32 @@ yarn global add @vue/cli-init
6767
vue init webpack my-project
6868
```
6969

70-
### Customization and Plugin Usage
70+
### Customizing Webpack Config
71+
72+
Create a `vue.config.js` in project root: (**Note:** if you have a `vue` field in your `package.json`, you need to move that here as well)
73+
74+
``` js
75+
// vue.config.js
76+
module.exports = {
77+
chainWebpack: chainableConfig => {
78+
// modify config with webpack-chain
79+
// https://github.com/mozilla-neutrino/webpack-chain
80+
},
81+
82+
configureWebpack: config => {
83+
// mutate config directly, or return new config
84+
},
85+
86+
// object literal will be merged into base config using webpack-merge
87+
configureWebpack: {
88+
// ...
89+
}
90+
}
91+
```
92+
93+
### Recipes and Plugin Usage
7194

72-
For a detailed guide on how to customize a project, recipes for common tasks, detailed usage for each plugin, please see the [full documentation](https://github.com/vuejs/vue-cli/blob/dev/docs/README.md).
95+
For a detailed guide with recipes for common tasks, detailed usage for each plugin, please see the [full documentation](https://github.com/vuejs/vue-cli/blob/dev/docs/README.md).
7396

7497
## Contributing
7598

0 commit comments

Comments
 (0)