mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(vite): use buildAssetsURL
for dynamic imports (#4844)
This commit is contained in:
parent
27d67360e4
commit
4079882bd4
@ -81,8 +81,8 @@ export const DynamicBasePlugin = createUnplugin(function (options: DynamicBasePl
|
||||
|
||||
if (id === 'vite/preload-helper') {
|
||||
// Define vite base path as buildAssetsUrl (i.e. including _nuxt/)
|
||||
s.prepend('import { buildAssetsDir } from \'#build/paths.mjs\';\n')
|
||||
s.replace(/const base = ['"]\/__NUXT_BASE__\/['"]/, 'const base = buildAssetsDir()')
|
||||
s.prepend('import { buildAssetsURL } from \'#build/paths.mjs\';\n')
|
||||
s.replace(/const base = ['"]\/__NUXT_BASE__\/['"]/, 'const base = buildAssetsURL()')
|
||||
}
|
||||
|
||||
// Sanitize imports
|
||||
|
Loading…
Reference in New Issue
Block a user