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