Skip to content

Commit

Permalink
Fail to get offline worker's URL
Browse files Browse the repository at this point in the history
This is what I found when looking how to do it:

evanw/esbuild#2508

evanw/esbuild#312
  • Loading branch information
ccouzens committed Apr 14, 2024
1 parent f8390f1 commit 1e0fec1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions esbuild/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ var esbuildOptions = esbuild.BuildOptions{
LogLevel: esbuild.LogLevelInfo,
Bundle: true,
Sourcemap: esbuild.SourceMapLinked,
Format: esbuild.FormatESModule,
Splitting: true,
}

func compileRust() {
Expand Down Expand Up @@ -66,6 +68,8 @@ func build() {
LogLevel: esbuildOptions.LogLevel,
Bundle: esbuildOptions.Bundle,
Sourcemap: esbuildOptions.Sourcemap,
Format: esbuildOptions.Format,
Splitting: esbuildOptions.Splitting,
EntryNames: "[name]-[hash]",
AssetNames: "[name]-[hash]",
MinifyWhitespace: true,
Expand Down Expand Up @@ -114,6 +118,8 @@ func serve() {
LogLevel: esbuildOptions.LogLevel,
Bundle: esbuildOptions.Bundle,
Sourcemap: esbuildOptions.Sourcemap,
Format: esbuildOptions.Format,
Splitting: esbuildOptions.Splitting,
EntryNames: "[name]",
AssetNames: "[name]",
Outdir: "../public/",
Expand Down
2 changes: 2 additions & 0 deletions src/game/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,6 @@ export async function initialiseApp(window: WindowType) {
app.root.classList.toggle("supports-share", "share" in window.navigator);

newMaze(app);

console.log(new URL("./offlineWorker.ts", import.meta.url));
}
1 change: 1 addition & 0 deletions src/game/offlineWorker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(42);

0 comments on commit 1e0fec1

Please sign in to comment.