We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6673b3e commit 1a16f12Copy full SHA for 1a16f12
packages/plugin-legacy/src/index.ts
@@ -419,6 +419,8 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
419
chunk.facadeModuleId
420
)
421
if (legacyEntryFilename) {
422
+ // `assets/foo.js` means importing "named register" in SystemJS
423
+ const nonBareBase = config.base === '' ? './' : config.base
424
tags.push({
425
tag: 'script',
426
attrs: {
@@ -427,7 +429,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
427
429
// script content will stay consistent - which allows using a constant
428
430
// hash value for CSP.
431
id: legacyEntryId,
- 'data-src': config.base + legacyEntryFilename
432
+ 'data-src': nonBareBase + legacyEntryFilename
433
},
434
children: systemJSInlineCode,
435
injectTo: 'body'
0 commit comments