Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
publicAssetsURL
1 parent 0cb095f commit 9d08cdfCopy full SHA for 9d08cdf
packages/vite/src/plugins/public-dirs.ts
@@ -24,10 +24,9 @@ export const VitePublicDirsPlugin = createUnplugin(() => {
24
vite: {
25
load: {
26
enforce: 'pre',
27
- handler (id, options) {
+ handler (id) {
28
if (id.startsWith(PREFIX)) {
29
- const helper = !options?.ssr || nitro.options.imports !== false ? '' : 'globalThis.'
30
- return `export default ${helper}__publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX.length)))})`
+ return `import { publicAssetsURL } from '#build/paths.mjs';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(PREFIX.length)))})`
31
}
32
33
},
0 commit comments