File tree 1 file changed +8
-3
lines changed
packages/compiler-sfc/src/templateCompilerModules
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,15 @@ export function urlToRequire(
24
24
// does not apply to absolute urls or urls that start with `@`
25
25
// since they are aliases
26
26
if ( firstChar === '.' || firstChar === '~' ) {
27
+ // Allow for full hostnames provided in options.base
28
+ const base = parseUriParts ( transformAssetUrlsOption . base )
29
+ const protocol = base . protocol || ''
30
+ const host = base . host ? protocol + '//' + base . host : ''
31
+ const basePath = base . path || '/'
27
32
// when packaged in the browser, path will be using the posix-
28
33
// only version provided by rollup-plugin-node-builtins.
29
- return `"${ ( path . posix || path ) . join (
30
- transformAssetUrlsOption . base ,
34
+ return `"${ host } ${ ( path . posix || path ) . join (
35
+ basePath ,
31
36
uriParts . path + ( uriParts . hash || '' )
32
37
) } "`
33
38
}
@@ -64,7 +69,7 @@ function parseUriParts(urlString: string): UrlWithStringQuery {
64
69
// @see https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
65
70
if ( 'string' === typeof urlString ) {
66
71
// check is an uri
67
- return uriParse ( urlString ) // take apart the uri
72
+ return uriParse ( urlString , false , true ) // take apart the uri
68
73
}
69
74
}
70
75
return returnValue
You can’t perform that action at this time.
0 commit comments