Skip to content

Commit

Permalink
fix(plugin-vue): allow disabling transformAssetUrls (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Feb 9, 2024
1 parent 69397c2 commit 0ff6fb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plugin-vue/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ export function resolveTemplateCompilerOptions(
let transformAssetUrls = options.template?.transformAssetUrls
// compiler-sfc should export `AssetURLOptions`
let assetUrlOptions //: AssetURLOptions | undefined
if (options.devServer) {
if (transformAssetUrls === false) {
// if explicitly disabled, let assetUrlOptions be undefined
} else if (options.devServer) {
// during dev, inject vite base so that compiler-sfc can transform
// relative paths directly to absolute paths without incurring an extra import
// request
Expand All @@ -145,7 +147,7 @@ export function resolveTemplateCompilerOptions(
includeAbsolute: !!devBase,
}
}
} else if (transformAssetUrls !== false) {
} else {
// build: force all asset urls into import requests so that they go through
// the assets plugin for asset registration
assetUrlOptions = {
Expand Down

0 comments on commit 0ff6fb7

Please sign in to comment.