Skip to content

Commit 1195aee

Browse files
committed
fix: asset output relative check
close #1545
1 parent e57e749 commit 1195aee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@vue/cli-service/lib/util/getAssetPath.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ const path = require('path')
33
module.exports = function getAssetPath (options, filePath, placeAtRootIfRelative) {
44
// if the user is using a relative URL, place js & css at dist root to ensure
55
// relative paths work properly
6-
if (placeAtRootIfRelative && options.baseUrl.charAt(0) !== '/') {
6+
if (
7+
placeAtRootIfRelative &&
8+
!(/^https?:/.test(options.baseUrl)) &&
9+
options.baseUrl.charAt(0) !== '/'
10+
) {
711
return filePath.replace(/^\w+\//, '')
812
}
913
return options.assetsDir

0 commit comments

Comments
 (0)