update HMR to support kjol
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
esbuild "github.com/evanw/esbuild/pkg/api"
|
||||
@@ -71,17 +70,16 @@ func (d *devServer) serveVendor(w http.ResponseWriter, r *http.Request) {
|
||||
// re-externalizing the OTHER vendored specifiers so they resolve (once) through
|
||||
// the import map. Mirrors the prod vendor resolution (NodePaths + development
|
||||
// condition) so the dev copy matches the shipped one.
|
||||
func (d *devServer) bundleVendor(relFile string) ([]byte, error) {
|
||||
entry := filepath.Join(d.vendor, filepath.FromSlash(relFile))
|
||||
func (d *devServer) bundleVendor(absFile string) ([]byte, error) {
|
||||
result := esbuild.Build(esbuild.BuildOptions{
|
||||
EntryPoints: []string{entry},
|
||||
EntryPoints: []string{absFile},
|
||||
Bundle: true,
|
||||
Write: false,
|
||||
Format: esbuild.FormatESModule,
|
||||
Target: esbuild.ES2022,
|
||||
Platform: esbuild.PlatformBrowser,
|
||||
Conditions: []string{"development"},
|
||||
NodePaths: []string{d.vendor},
|
||||
NodePaths: d.vendorDirs,
|
||||
Sourcemap: esbuild.SourceMapInline,
|
||||
LogLevel: esbuild.LogLevelSilent,
|
||||
Plugins: []esbuild.Plugin{d.vendorSharedExternalPlugin()},
|
||||
|
||||
Reference in New Issue
Block a user