Fix SPA: bundle preact instead of leaving as external require (closes #48) #49

Merged
sneak merged 1 commits from fix/spa-preact-bundling into main 2026-03-07 14:53:14 +01:00
4 changed files with 6 additions and 14 deletions
Showing only changes of commit 2a29f41aa8 - Show all commits

View File

@@ -16,19 +16,11 @@ fi
mkdir -p dist
# Build JS bundle
${NPX:+$NPX} esbuild src/app.jsx \
--bundle \
--minify \
--jsx-factory=h \
--jsx-fragment=Fragment \
--define:process.env.NODE_ENV=\"production\" \
--external:preact \
--outfile=dist/app.js \
2>/dev/null || \
# Build JS bundle — preact must be bundled (no CDN/external loader)
${NPX:+$NPX} esbuild src/app.jsx \
--bundle \
--minify \
--format=esm \
--jsx-factory=h \
--jsx-fragment=Fragment \
--define:process.env.NODE_ENV=\"production\" \

4
web/dist/app.js vendored

File diff suppressed because one or more lines are too long

2
web/dist/index.html vendored
View File

@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/app.js"></script>
<script type="module" src="/app.js"></script>
</body>
</html>

View File

@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/app.js"></script>
<script type="module" src="/app.js"></script>
</body>
</html>