Skip to content

Commit e99692b

Browse files
committed
📘 doc: adjust build script
1 parent c095eb8 commit e99692b

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 1.4.3 - 13 Oct 2025
2-
Bug fix:
2+
Improvement:
3+
- adjust build script
34
- remove stat cache
45

56
# 1.4.2 - 13 Oct 2025

build.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ import { build, type Options } from 'tsup'
33

44
await $`rm -rf dist`
55

6+
const external = ['fast-decode-uri-component']
7+
68
const tsupConfig: Options = {
79
entry: ['src/**/*.ts'],
10+
minifySyntax: true,
11+
minifyWhitespace: false,
12+
minifyIdentifiers: false,
813
splitting: false,
914
sourcemap: false,
1015
clean: true,
11-
bundle: true
16+
bundle: false,
17+
external
1218
} satisfies Options
1319

1420
await Promise.all([
@@ -18,13 +24,15 @@ await Promise.all([
1824
format: 'esm',
1925
target: 'node20',
2026
cjsInterop: false,
27+
external,
2128
...tsupConfig
2229
}),
2330
// ? tsup cjs
2431
build({
2532
outDir: 'dist/cjs',
2633
format: 'cjs',
2734
target: 'node20',
35+
external,
2836
// dts: true,
2937
...tsupConfig
3038
})

example/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import { Elysia } from 'elysia'
2-
32
import { staticPlugin } from '../src/index'
43

5-
import html from '../public/html/index.html'
6-
7-
const app = new Elysia()
8-
.use(
9-
await staticPlugin()
10-
)
11-
.listen(3000)
4+
const app = new Elysia().use(await staticPlugin()).listen(3000)
125

136
await app.modules

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elysiajs/static",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"license": "MIT",
55
"scripts": {
66
"dev": "bun run --watch example/index.ts",

0 commit comments

Comments
 (0)