Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit ae6595f

Browse files
Josh Pikenchanged
authored andcommitted
fix: cache busting should not be used if the target is a server (#1394)
fixes #1393
1 parent 26018e9 commit ae6595f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BundleSource.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,14 @@ ${file.headerContent ? file.headerContent.join("\n") : ""}`,
267267
}
268268
if (this.context.sourceMapsProject || this.context.sourceMapsVendor) {
269269
let sourceName = /[^\/]*$/.exec(this.context.output.filename)[0];
270+
271+
if(this.context.target === "server"){
272+
// cache busting should not be used if the target is a server, as it will interfere with local filesystem resolution
273+
this.concat.add(null, `//# sourceMappingURL=${sourceName}.js.map`);
274+
} else {
275+
this.concat.add(null, `//# sourceMappingURL=${sourceName}.js.map?tm=${this.context.cacheBustPreffix}`);
276+
}
270277

271-
this.concat.add(null, `//# sourceMappingURL=${sourceName}.js.map?tm=${this.context.cacheBustPreffix}`);
272278
}
273279
}
274280

0 commit comments

Comments
 (0)