We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e195fe2 commit d42184aCopy full SHA for d42184a
src/plugins/dev.ts
@@ -93,7 +93,10 @@ export function DevPlugin(ctx: PWAPluginContext) {
93
94
const { options } = ctx
95
if (!options.disable && options.devOptions.enabled && options.strategies === 'injectManifest' && !options.selfDestroying) {
96
- const name = id.startsWith(options.base) ? id.slice(options.base.length) : id
+ let name = id.startsWith(options.base) ? id.slice(options.base.length) : id
97
+ // Vite will remove the base from the request, and so we need to remove the leading /: fixes issue #683
98
+ if (name.length && name[0] === '/')
99
+ name = name.slice(1)
100
// the sw must be registered with .js extension in the browser, here we detect that request:
101
// - the .js file and source with .ts, or
102
// - the .ts source file
0 commit comments