Skip to content
Search

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

  • Relative publicPath has some limitations and should be avoided when:
  • You are using HTML5 history.pushState routing;
  • You are using the pages option to build a multi-paged app.

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>

See also

Favorite site

author Zer0 sitemap