Skip to content

Commit ee82c3e

Browse files
committed
refactor: only place css at root when using relative baseUrl
1 parent 625d541 commit ee82c3e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848
}
4949
```
5050

51-
The value can also be set to an empty string (`''`) so that all assets are linked using relative paths, so that the bundle can be used in a file system based environment like a Cordova hybrid app. The caveat is that this will force the generated CSS files to always be placed at the root of the output directory to ensure urls in your CSS work correctly.
51+
The value can also be set to an empty string (`''`) so that all assets are linked using relative paths, so that the bundle can be used in a file system based environment like a Cordova hybrid app. **Note that this will force the generated CSS files to always be placed at the root of the output directory to ensure urls in your CSS work correctly.**
5252

5353
::: tip
5454
Always use `baseUrl` instead of modifying webpack `output.publicPath`.

packages/@vue/cli-service/lib/config/prod.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module.exports = (api, options) => {
55
const getAssetPath = require('../util/getAssetPath')
66
const filename = getAssetPath(
77
options,
8-
`js/[name]${isLegacyBundle ? `-legacy` : ``}.[chunkhash:8].js`,
9-
true /* placeAtRootIfRelative */
8+
`js/[name]${isLegacyBundle ? `-legacy` : ``}.[chunkhash:8].js`
109
)
1110

1211
webpackConfig

0 commit comments

Comments
 (0)