|
|
@ -71,7 +71,7 @@ func commonSetup(dev bool) (*esbuild.BuildOptions, error) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
JSXMode: esbuild.JSXModeAutomatic,
|
|
|
|
JSX: esbuild.JSXAutomatic,
|
|
|
|
}, nil
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -137,16 +137,19 @@ func runEsbuildServe(buildOptions esbuild.BuildOptions) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalf("Cannot parse port: %v", err)
|
|
|
|
log.Fatalf("Cannot parse port: %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result, err := esbuild.Serve(esbuild.ServeOptions{
|
|
|
|
buildContext, ctxErr := esbuild.Context(buildOptions)
|
|
|
|
|
|
|
|
if ctxErr != nil {
|
|
|
|
|
|
|
|
log.Fatalf("Cannot create esbuild context: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
result, err := buildContext.Serve(esbuild.ServeOptions{
|
|
|
|
Port: uint16(port),
|
|
|
|
Port: uint16(port),
|
|
|
|
Host: host,
|
|
|
|
Host: host,
|
|
|
|
Servedir: "./",
|
|
|
|
Servedir: "./",
|
|
|
|
}, buildOptions)
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalf("Cannot start esbuild server: %v", err)
|
|
|
|
log.Fatalf("Cannot start esbuild server: %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.Printf("Listening on http://%s:%d\n", result.Host, result.Port)
|
|
|
|
log.Printf("Listening on http://%s:%d\n", result.Host, result.Port)
|
|
|
|
result.Wait()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func runEsbuild(buildOptions esbuild.BuildOptions) esbuild.BuildResult {
|
|
|
|
func runEsbuild(buildOptions esbuild.BuildOptions) esbuild.BuildResult {
|
|
|
|