Skip to content

feat: deprecate confusing baseUrl option, use publicPath instead. #3143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

* assetsDir can be an empty string ([5d49d57](https://github.com/vuejs/vue-cli/commit/5d49d57)), closes [#2511](https://github.com/vuejs/vue-cli/issues/2511)
* relax webpack version requirement ([73923de](https://github.com/vuejs/vue-cli/commit/73923de)), closes [#2873](https://github.com/vuejs/vue-cli/issues/2873) [#2892](https://github.com/vuejs/vue-cli/issues/2892)
* **cli-service:** do not display absolute baseUrl ([#2900](https://github.com/vuejs/vue-cli/issues/2900)) ([6d35461](https://github.com/vuejs/vue-cli/commit/6d35461))
* **cli-service:** do not display absolute publicPath ([#2900](https://github.com/vuejs/vue-cli/issues/2900)) ([6d35461](https://github.com/vuejs/vue-cli/commit/6d35461))
#### Features

* add support for loading WebAssembly and ES Modules ([#2819](https://github.com/vuejs/vue-cli/issues/2819)) ([2db8d18](https://github.com/vuejs/vue-cli/commit/2db8d18))
Expand Down Expand Up @@ -99,7 +99,7 @@
#### Bug Fixes

* assetsDir can be an empty string, fixes [#2511](https://github.com/vuejs/vue-cli/issues/2511) ([5d49d57](https://github.com/vuejs/vue-cli/commit/5d49d57))
* do not display absolute baseUrl ([#2900](https://github.com/vuejs/vue-cli/pull/2900)) ([6d35461](https://github.com/vuejs/vue-cli/commit/6d35461))
* do not display absolute publicPath ([#2900](https://github.com/vuejs/vue-cli/pull/2900)) ([6d35461](https://github.com/vuejs/vue-cli/commit/6d35461))

# 3.1.3

Expand Down Expand Up @@ -549,7 +549,7 @@

#### Bug Fixes

* allow relative baseUrl other than ./ ([#2168](https://github.com/vuejs/vue-cli/issues/2168)) ([d14d4e6](https://github.com/vuejs/vue-cli/commit/d14d4e6))
* allow relative publicPath other than ./ ([#2168](https://github.com/vuejs/vue-cli/issues/2168)) ([d14d4e6](https://github.com/vuejs/vue-cli/commit/d14d4e6))
* inspect --plugins should log plugin names from webpack-merge ([#2201](https://github.com/vuejs/vue-cli/issues/2201)) ([69a4fb3](https://github.com/vuejs/vue-cli/commit/69a4fb3))
* minify embedded CSS with extract: false ([a2c767e](https://github.com/vuejs/vue-cli/commit/a2c767e)), closes [#2214](https://github.com/vuejs/vue-cli/issues/2214)
* preserve rule names when configureWebpack is present ([2257034](https://github.com/vuejs/vue-cli/commit/2257034)), closes [#2206](https://github.com/vuejs/vue-cli/issues/2206)
Expand All @@ -559,7 +559,7 @@

#### Bug Fixes

* fix css output location for relative baseUrl + more details in docs ([1e7fa2c](https://github.com/vuejs/vue-cli/commit/1e7fa2c))
* fix css output location for relative publicPath + more details in docs ([1e7fa2c](https://github.com/vuejs/vue-cli/commit/1e7fa2c))
* **eslint:** always emit error when lintOnSave === error + improve docs ([d96a794](https://github.com/vuejs/vue-cli/commit/d96a794)), closes [#2162](https://github.com/vuejs/vue-cli/issues/2162)

## other
Expand Down Expand Up @@ -1380,7 +1380,7 @@ will need to explicitly install `typescript` in your project.

* fine tune chunk splitting ([4db901c](https://github.com/vuejs/vue-cli/commit/4db901c)), closes [#1488](https://github.com/vuejs/vue-cli/issues/1488)
* fix invoke output ([d65a251](https://github.com/vuejs/vue-cli/commit/d65a251))
* only provide baseUrl fix if baseUrl provided ([#1421](https://github.com/vuejs/vue-cli/issues/1421)) ([af1151a](https://github.com/vuejs/vue-cli/commit/af1151a))
* only provide publicPath fix if publicPath provided ([#1421](https://github.com/vuejs/vue-cli/issues/1421)) ([af1151a](https://github.com/vuejs/vue-cli/commit/af1151a))
* **build:** default to development mode in build --watch ([#1430](https://github.com/vuejs/vue-cli/issues/1430)) ([3193b0d](https://github.com/vuejs/vue-cli/commit/3193b0d))
* **env:** preserve existing env vars so load in reverse order. ([#1503](https://github.com/vuejs/vue-cli/issues/1503)) ([7c1ef24](https://github.com/vuejs/vue-cli/commit/7c1ef24))
* **serve:** make sockjs url fixed with host ([#1476](https://github.com/vuejs/vue-cli/issues/1476)) ([2cbe373](https://github.com/vuejs/vue-cli/commit/2cbe373))
Expand All @@ -1390,7 +1390,7 @@ will need to explicitly install `typescript` in your project.

* allow configuring css-loader options via css.loaderOptions.css ([7d06f09](https://github.com/vuejs/vue-cli/commit/7d06f09)), closes [#1484](https://github.com/vuejs/vue-cli/issues/1484)
* allow configuring postcss-loader via css.loaderOptions.postcss ([0ba111e](https://github.com/vuejs/vue-cli/commit/0ba111e))
* allow using relative baseUrl ([dc38211](https://github.com/vuejs/vue-cli/commit/dc38211))
* allow using relative publicPath ([dc38211](https://github.com/vuejs/vue-cli/commit/dc38211))
* bail when user directly mutate output.publicPath ([1732007](https://github.com/vuejs/vue-cli/commit/1732007))
* **build:** support named exports when building --target lib with js/ts entry ([1dc47eb](https://github.com/vuejs/vue-cli/commit/1dc47eb)), closes [#1436](https://github.com/vuejs/vue-cli/issues/1436)
* **cli-service:** support --no-clean flag ([#1457](https://github.com/vuejs/vue-cli/issues/1457)) ([c19bbff](https://github.com/vuejs/vue-cli/commit/c19bbff)), closes [#1446](https://github.com/vuejs/vue-cli/issues/1446)
Expand Down Expand Up @@ -1477,7 +1477,7 @@ but should not affect normal test cases
* fix caching dependency (close [#1384](https://github.com/vuejs/vue-cli/issues/1384)) ([9846cd5](https://github.com/vuejs/vue-cli/commit/9846cd5))
#### Features

* respect baseUrl during development ([a9e1286](https://github.com/vuejs/vue-cli/commit/a9e1286))
* respect publicPath during development ([a9e1286](https://github.com/vuejs/vue-cli/commit/a9e1286))

## cli-ui

Expand All @@ -1496,7 +1496,7 @@ but should not affect normal test cases

### BREAKING CHANGES

* `devBaseUrl` option has been removed. `baseUrl` now works for
* `devBaseUrl` option has been removed. `publicPath` now works for
both development and production. To use different paths for prod/dev, use
conditional values based on `process.env.NODE_ENV` in `vue.config.js`.

Expand Down Expand Up @@ -1943,7 +1943,7 @@ sepcify the default mode for a registered command, the plugins should expose
* add name to chunk file output ([#1173](https://github.com/vuejs/vue-cli/issues/1173)) ([1fc9593](https://github.com/vuejs/vue-cli/commit/1fc9593))
* **build:** copy plugin should be loaded in all cases ([87892a5](https://github.com/vuejs/vue-cli/commit/87892a5)), closes [#1073](https://github.com/vuejs/vue-cli/issues/1073)
* **build-wc:** honor custom component name for single file wc builds ([#1182](https://github.com/vuejs/vue-cli/issues/1182)) ([2b236e0](https://github.com/vuejs/vue-cli/commit/2b236e0)), closes [#1146](https://github.com/vuejs/vue-cli/issues/1146)
* **cli-service:** should not add a leading slash to baseUrl when it is absolute ([#1172](https://github.com/vuejs/vue-cli/issues/1172)) ([abb82ab](https://github.com/vuejs/vue-cli/commit/abb82ab)), closes [#1084](https://github.com/vuejs/vue-cli/issues/1084)
* **cli-service:** should not add a leading slash to publicPath when it is absolute ([#1172](https://github.com/vuejs/vue-cli/issues/1172)) ([abb82ab](https://github.com/vuejs/vue-cli/commit/abb82ab)), closes [#1084](https://github.com/vuejs/vue-cli/issues/1084)
* **serve:** don't set header origin if using an agent ([#1179](https://github.com/vuejs/vue-cli/issues/1179)) ([79bc088](https://github.com/vuejs/vue-cli/commit/79bc088))
* **ui:** analyze bundle error handling ([d5d0b76](https://github.com/vuejs/vue-cli/commit/d5d0b76))
* **ui:** DashboardPlugin clean up ([0ac38da](https://github.com/vuejs/vue-cli/commit/0ac38da))
Expand Down Expand Up @@ -2333,7 +2333,7 @@ sepcify the default mode for a registered command, the plugins should expose
#### Bug Fixes

* **dev-server:** dev server behind NAT network ([#868](https://github.com/vuejs/vue-cli/issues/868)) ([bbc931c](https://github.com/vuejs/vue-cli/commit/bbc931c)), closes [#828](https://github.com/vuejs/vue-cli/issues/828)
* fix baseUrl normalization (close [#900](https://github.com/vuejs/vue-cli/issues/900)) ([89982df](https://github.com/vuejs/vue-cli/commit/89982df))
* fix publicPath normalization (close [#900](https://github.com/vuejs/vue-cli/issues/900)) ([89982df](https://github.com/vuejs/vue-cli/commit/89982df))
* fix options for css optimize plugin (close [#918](https://github.com/vuejs/vue-cli/issues/918)) ([7681106](https://github.com/vuejs/vue-cli/commit/7681106))
* respect --dest when copying static assets (close [#909](https://github.com/vuejs/vue-cli/issues/909)) ([57ce32a](https://github.com/vuejs/vue-cli/commit/57ce32a))
* respect dotfiles in public dir (fix [#880](https://github.com/vuejs/vue-cli/issues/880)) ([59ac4f4](https://github.com/vuejs/vue-cli/commit/59ac4f4))
Expand Down
16 changes: 10 additions & 6 deletions docs/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ module.exports = {

### baseUrl

Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead.

### publicPath

- Type: `string`
- Default: `'/'`

The base URL your application bundle will be deployed at. This is the equivalent of webpack's `output.publicPath`, but Vue CLI also needs this value for other purposes, so you should **always use `baseUrl` instead of modifying webpack `output.publicPath`**.
The base URL your application bundle will be deployed at (known as `baseUrl` before Vue CLI 3.3). This is the equivalent of webpack's `output.publicPath`, but Vue CLI also needs this value for other purposes, so you should **always use `publicPath` instead of modifying webpack `output.publicPath`**.

By default, Vue CLI assumes your app will be deployed at the root of a domain, e.g. `https://www.my-app.com/`. If your app is deployed at a sub-path, you will need to specify that sub-path using this option. For example, if your app is deployed at `https://www.foobar.com/my-app/`, set `baseUrl` to `'/my-app/'`.
By default, Vue CLI assumes your app will be deployed at the root of a domain, e.g. `https://www.my-app.com/`. If your app is deployed at a sub-path, you will need to specify that sub-path using this option. For example, if your app is deployed at `https://www.foobar.com/my-app/`, set `publicPath` to `'/my-app/'`.

The value can also be set to an empty string (`''`) or a relative path (`./`) so that all assets are linked using relative paths. This allows the built bundle to be deployed under any public path, or used in a file system based environment like a Cordova hybrid app.

::: warning Limitations of relative baseUrl
Relative `baseUrl` has some limitations and should be avoided when:
::: warning Limitations of relative publicPath
Relative `publicPath` has some limitations and should be avoided when:

- You are using HTML5 `history.pushState` routing;

Expand All @@ -52,7 +56,7 @@ module.exports = {

``` js
module.exports = {
baseUrl: process.env.NODE_ENV === 'production'
publicPath: process.env.NODE_ENV === 'production'
? '/production-sub-path/'
: '/'
}
Expand Down Expand Up @@ -304,7 +308,7 @@ module.exports = {

- Some values like `host`, `port` and `https` may be overwritten by command line flags.

- Some values like `publicPath` and `historyApiFallback` should not be modified as they need to be synchronized with [baseUrl](#baseurl) for the dev server to function properly.
- Some values like `publicPath` and `historyApiFallback` should not be modified as they need to be synchronized with [publicPath](#baseurl) for the dev server to function properly.

### devServer.proxy

Expand Down
20 changes: 10 additions & 10 deletions docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

If you are using Vue CLI along with a backend framework that handles static assets as part of its deployment, all you need to do is make sure Vue CLI generates the built files in the correct location, and then follow the deployment instruction of your backend framework.

If you are developing your frontend app separately from your backend - i.e. your backend exposes an API for your frontend to talk to, then your frontend is essentially a purely static app. You can deploy the built content in the `dist` directory to any static file server, but make sure to set the correct [baseUrl](../config/#baseurl).
If you are developing your frontend app separately from your backend - i.e. your backend exposes an API for your frontend to talk to, then your frontend is essentially a purely static app. You can deploy the built content in the `dist` directory to any static file server, but make sure to set the correct [publicPath](../config/#baseurl).

### Previewing Locally

The `dist` directory is meant to be served by an HTTP server (unless you've configured `baseUrl` to be a relative value), so it will not work if you open `dist/index.html` directly over `file://` protocol. The easiest way to preview your production build locally is using a Node.js static file server, for example [serve](https://github.com/zeit/serve):
The `dist` directory is meant to be served by an HTTP server (unless you've configured `publicPath` to be a relative value), so it will not work if you open `dist/index.html` directly over `file://` protocol. The easiest way to preview your production build locally is using a Node.js static file server, for example [serve](https://github.com/zeit/serve):

``` bash
npm install -g serve
Expand All @@ -35,15 +35,15 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser

### GitHub Pages

1. Set correct `baseUrl` in `vue.config.js`.
1. Set correct `publicPath` in `vue.config.js`.

If you are deploying to `https://<USERNAME>.github.io/`, you can omit `baseUrl` as it defaults to `"/"`.
If you are deploying to `https://<USERNAME>.github.io/`, you can omit `publicPath` as it defaults to `"/"`.

If you are deploying to `https://<USERNAME>.github.io/<REPO>/`, (i.e. your repository is at `https://github.com/<USERNAME>/<REPO>`), set `baseUrl` to `"/<REPO>/"`. For example, if your repo name is "my-project", your `vue.config.js` should look like this:
If you are deploying to `https://<USERNAME>.github.io/<REPO>/`, (i.e. your repository is at `https://github.com/<USERNAME>/<REPO>`), set `publicPath` to `"/<REPO>/"`. For example, if your repo name is "my-project", your `vue.config.js` should look like this:

``` js
module.exports = {
baseUrl: process.env.NODE_ENV === 'production'
publicPath: process.env.NODE_ENV === 'production'
? '/my-project/'
: '/'
}
Expand Down Expand Up @@ -112,7 +112,7 @@ Typically, your static website will be hosted on https://yourUserName.gitlab.io/
// make sure you update `yourProjectName` with the name of your GitLab project

module.exports = {
baseUrl: process.env.NODE_ENV === 'production'
publicPath: process.env.NODE_ENV === 'production'
? '/yourProjectName/'
: '/'
}
Expand Down Expand Up @@ -282,11 +282,11 @@ Verify your project is successfully published by Surge by visiting `myawesomepro

1. As described in the [Bitbucket documentation](https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html) you need to create a repository named exactly `<USERNAME>.bitbucket.io`.

2. It is possible to publish to a subfolder of the main repository, for instance if you want to have multiple websites. In that case set correct `baseUrl` in `vue.config.js`.
2. It is possible to publish to a subfolder of the main repository, for instance if you want to have multiple websites. In that case set correct `publicPath` in `vue.config.js`.

If you are deploying to `https://<USERNAME>.bitbucket.io/`, you can omit `baseUrl` as it defaults to `"/"`.
If you are deploying to `https://<USERNAME>.bitbucket.io/`, you can omit `publicPath` as it defaults to `"/"`.

If you are deploying to `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, set `baseUrl` to `"/<SUBFOLDER>/"`. In this case the directory structure of the repository should reflect the url structure, for instance the repository should have a `/<SUBFOLDER>` directory.
If you are deploying to `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, set `publicPath` to `"/<SUBFOLDER>/"`. In this case the directory structure of the repository should reflect the url structure, for instance the repository should have a `/<SUBFOLDER>` directory.

3. Inside your project, create `deploy.sh` with the following content and run it to deploy:

Expand Down
8 changes: 4 additions & 4 deletions docs/guide/html-and-static-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In addition to the [default values exposed by `html-webpack-plugin`](https://git
```

See also:
- [baseUrl](../config/#baseurl)
- [publicPath](../config/#baseurl)

### Preload

Expand Down Expand Up @@ -166,7 +166,7 @@ Note we recommend importing assets as part of your module dependency graph so th
- Missing files cause compilation errors instead of 404 errors for your users.
- Result filenames include content hashes so you don’t need to worry about browsers caching their old versions.

The `public` directory is provided as an **escape hatch**, and when you reference it via absolute path, you need to take into account where your app will be deployed. If your app is not deployed at the root of a domain, you will need to prefix your URLs with the [baseUrl](../config/#baseurl):
The `public` directory is provided as an **escape hatch**, and when you reference it via absolute path, you need to take into account where your app will be deployed. If your app is not deployed at the root of a domain, you will need to prefix your URLs with the [publicPath](../config/#baseurl):

- In `public/index.html` or other HTML files used as templates by `html-webpack-plugin`, you need to prefix the link with `<%= BASE_URL %>`:

Expand All @@ -179,15 +179,15 @@ The `public` directory is provided as an **escape hatch**, and when you referenc
``` js
data () {
return {
baseUrl: process.env.BASE_URL
publicPath: process.env.BASE_URL
}
}
```

Then:

``` html
<img :src="`${baseUrl}my-image.png`">
<img :src="`${publicPath}my-image.png`">
```

### When to use the `public` folder
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/mode-and-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ During build, `process.env.VUE_APP_SECRET` will be replaced by the corresponding
In addition to `VUE_APP_*` variables, there are also two special variables that will always be available in your app code:

- `NODE_ENV` - this will be one of `"development"`, `"production"` or `"test"` depending on the [mode](#modes) the app is running in.
- `BASE_URL` - this corresponds to the `baseUrl` option in `vue.config.js` and is the base path your app is deployed at.
- `BASE_URL` - this corresponds to the `publicPath` option in `vue.config.js` and is the base path your app is deployed at.

All resolved env variables will be available inside `public/index.html` as discussed in [HTML - Interpolation](./html-and-static-assets.md#interpolation).

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
The object will be merged into the final webpack config using [webpack-merge](https://github.com/survivejs/webpack-merge).

::: warning
Some webpack options are set based on values in `vue.config.js` and should not be mutated directly. For example, instead of modifying `output.path`, you should use the `outputDir` option in `vue.config.js`; instead of modifying `output.publicPath`, you should use the `baseUrl` option in `vue.config.js`. This is because the values in `vue.config.js` will be used in multiple places inside the config to ensure everything works properly together.
Some webpack options are set based on values in `vue.config.js` and should not be mutated directly. For example, instead of modifying `output.path`, you should use the `outputDir` option in `vue.config.js`; instead of modifying `output.publicPath`, you should use the `publicPath` option in `vue.config.js`. This is because the values in `vue.config.js` will be used in multiple places inside the config to ensure everything works properly together.
:::

If you need conditional behavior based on the environment, or want to directly mutate the config, use a function (which will be lazy evaluated after the env variables are set). The function receives the resolved config as the argument. Inside the function, you can either mutate the config directly, OR return an object which will be merged:
Expand Down
Loading