update solid compiler
This commit is contained in:
@@ -26,15 +26,15 @@ func esbuildDefine() map[string]string {
|
||||
}
|
||||
|
||||
// resolveEntryPoint returns the path (relative to frontendDir) of the
|
||||
// SPA entry point, preferring app.ts over app.js.
|
||||
// SPA entry point, preferring app.tsx over app.js.
|
||||
func resolveEntryPoint() string {
|
||||
if _, err := os.Stat(filepath.Join(frontendDir, "src/app.ts")); err == nil {
|
||||
return "src/app.ts"
|
||||
if _, err := os.Stat(filepath.Join(frontendDir, "src/app.tsx")); err == nil {
|
||||
return "src/app.tsx"
|
||||
}
|
||||
return "src/app.js"
|
||||
}
|
||||
|
||||
// bundleJS bundles the SPA entry (app.ts/app.js) into bundle.min.js.
|
||||
// bundleJS bundles the SPA entry (app.tsx/app.js) into bundle.min.js.
|
||||
func bundleJS() (bundleStats, error) {
|
||||
return bundleJSEntry(filepath.Join(frontendDir, resolveEntryPoint()), "bundle.min.js")
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func bundleJSEntry(entry, outName string) (bundleStats, error) {
|
||||
// drop leading `../` segments. esbuild writes paths relative to the output
|
||||
// file's directory; since the bundle lives in wwwroot/ and the sources live
|
||||
// in frontend/, every entry starts with `../frontend/`. Stripping the prefix
|
||||
// yields project-rooted paths like `frontend/src/app.ts`.
|
||||
// yields project-rooted paths like `frontend/src/app.tsx`.
|
||||
func stripSourcemapParentPrefix(mapPath string) error {
|
||||
data, err := os.ReadFile(mapPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user