File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/compiler-sfc/src/templateCompilerModules Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,15 @@ export function urlToRequire(
2424 // does not apply to absolute urls or urls that start with `@`
2525 // since they are aliases
2626 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 || '/'
2732 // when packaged in the browser, path will be using the posix-
2833 // 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 ,
3136 uriParts.path + (uriParts.hash || '')
3237 )}"`
3338 }
@@ -64,7 +69,7 @@ function parseUriParts(urlString: string): UrlWithStringQuery {
6469 // @see https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
6570 if ('string' === typeof urlString) {
6671 // check is an uri
67- return uriParse(urlString) // take apart the uri
72+ return uriParse(urlString, false, true ) // take apart the uri
6873 }
6974 }
7075 return returnValue
You can’t perform that action at this time.
0 commit comments