mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
feat(compiler-sfc): support includeAbsolute in transformAssetUrl
This commit is contained in:
parent
96cd1d03fd
commit
8f5817a7c9
@ -13,6 +13,10 @@ export interface TransformAssetUrlsOptions {
|
||||
* imports, they will be directly rewritten to absolute urls.
|
||||
*/
|
||||
base?: string
|
||||
/**
|
||||
* If true, also processes absolute urls.
|
||||
*/
|
||||
includeAbsolute?: boolean
|
||||
}
|
||||
|
||||
const defaultOptions: AssetURLOptions = {
|
||||
|
@ -31,7 +31,12 @@ export function urlToRequire(
|
||||
return returnValue
|
||||
}
|
||||
|
||||
if (firstChar === '.' || firstChar === '~' || firstChar === '@') {
|
||||
if (
|
||||
transformAssetUrlsOption.includeAbsolute ||
|
||||
firstChar === '.' ||
|
||||
firstChar === '~' ||
|
||||
firstChar === '@'
|
||||
) {
|
||||
if (!uriParts.hash) {
|
||||
return `require("${url}")`
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user