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.
init
no-modules
1 parent 56e4d7d commit 93fedf8Copy full SHA for 93fedf8
crates/cli-support/src/js/mod.rs
@@ -437,6 +437,18 @@ impl<'a> Context<'a> {
437
module = import.meta.url.replace(/\\.js$/, '_bg.wasm');
438
}"
439
}
440
+ OutputMode::NoModules { .. } => {
441
+ "\
442
+ if (typeof module === 'undefined') {
443
+ let src;
444
+ if (self.document === undefined) {
445
+ src = self.location.href;
446
+ } else {
447
+ src = self.document.currentScript.src;
448
+ }
449
+ module = src.replace(/\\.js$/, '_bg.wasm');
450
+ }"
451
452
_ => "",
453
};
454
0 commit comments