Vue.config.js
lastmod 2022-05-31created 2020-10-167 edits
Explanation of vue.config.js, the configuration file of Vue CLI.
baseUrl
Deprecated since Vue CLI 3.3; use #publicPath instead.
publicPath
Deployment path. If you want to deploy to https://www.foobar.com/my-app/, set publicPath to '/my-app/'.
For a relative path, leave it empty ('') or set it to a relative path ('./').
| WARNING |
| Limitations of relative publicPath
|
This value is also respected during development. If you want your dev server to be served at root instead, you can use a conditional value:
```js> module.exports = { publicPath: process.env.NODE_ENV === 'production' ? '/production-sub-path/' : '/' }
== [[SourceMap]] configuration == <syntaxhighlight lang=
```
module.exports = {
transpileDependencies: ["vuetify"],runtimeCompiler: true,configureWebpack: config => {if (process.env.NODE_ENV !== "production") {return { devtool: "source-map" };}}
};
</syntaxhighlight>
See SourceMap for details.
DevServer Proxy
<syntaxhighlight lang="javascript> module.exports = {
devServer: {proxy: {'/plugins': {target: 'http://localhost:20000',changeOrigin: true,},},},
};
</syntaxhighlight>