File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -379,6 +379,13 @@ impl<'a> Context<'a> {
379
379
OutputMode :: NoModules { global } => {
380
380
js. push_str ( "const __exports = {};\n " ) ;
381
381
js. push_str ( "let script_src;\n " ) ;
382
+ js. push_str ( "\
383
+ if (typeof document === 'undefined') {
384
+ script_src = location.href;
385
+ } else {
386
+ script_src = document.currentScript.src;
387
+ }"
388
+ ) ;
382
389
js. push_str ( "let wasm;\n " ) ;
383
390
init = self . gen_init ( needs_manual_start, None ) ?;
384
391
footer. push_str ( & format ! ( "{} = Object.assign(init, __exports);\n " , global) ) ;
@@ -701,11 +708,6 @@ impl<'a> Context<'a> {
701
708
stem = self . config. stem( ) ?
702
709
) ,
703
710
OutputMode :: NoModules { .. } => "\
704
- if (typeof document === 'undefined') {
705
- script_src = location.href;
706
- } else {
707
- script_src = document.currentScript.src;
708
- }
709
711
if (typeof input === 'undefined') {
710
712
input = script_src.replace(/\\ .js$/, '_bg.wasm');
711
713
}"
You can’t perform that action at this time.
0 commit comments