Skip to content

Commit 80e40bb

Browse files
authored
Merge pull request #52 from kmiller68/pathname-browser-dart
Add the pathname when resolving flute.dart2wasm.mjs
2 parents 8f56a4e + b2c9274 commit 80e40bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: Dart/benchmark.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ class Benchmark {
269269
if (isInBrowser) {
270270
// In browsers, relative imports don't work since we are not in a module.
271271
// (`import.meta.url` is not defined.)
272-
this.dart2wasmJsModule = await import(location.origin + "/Dart/build/flute.dart2wasm.mjs");
272+
let pathname = location.pathname.match(/(.*)index\.html/)[1];
273+
this.dart2wasmJsModule = await import(location.origin + pathname + "./Dart/build/flute.dart2wasm.mjs");
273274
} else {
274275
// In shells, relative imports require different paths, so try with and
275276
// without the "./" prefix (e.g., JSC requires it).

0 commit comments

Comments
 (0)