Skip to content

Commit e05521b

Browse files
committed
migrate to deno bundle
1 parent 8b6c475 commit e05521b

File tree

9 files changed

+32
-307
lines changed

9 files changed

+32
-307
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Deno
2828
uses: denoland/setup-deno@v2
2929
with:
30-
deno-version: v2.x
30+
deno-version: v2.4.x
3131
- name: Install Dependencies
3232
run: deno install --frozen
3333
- name: Build

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ After using `git clone`, you'll need [Deno](https://deno.com/) for this project.
1515
Then you'll need to install the dependencies before running any command:
1616
`deno install --frozen`.
1717

18-
After this, you can start away by running `deno task start` then open the link
19-
provided by the stdout to open a local copy of ilo Token. The server will
20-
auto-reload the webpage whenever there are changes on the code.
18+
After this, you can start away by running `deno task start` then open
19+
`./dist/index.html` using your favorite browser. The server will automatically
20+
rebuild the project. However, you need to manually refresh the page.
2121

2222
Run `deno task` to see more useful command lines.

build/build.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

build/config.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

build/dev.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

deno.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"tasks": {
66
"build": {
77
"description": "Builds every static files needed for GitHub pages. This builds the dictionary first at `./dictionary/dictionary.ts` then the distribution code `./dist/main.js`.",
8-
"command": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./build/build.ts"
8+
"command": "deno bundle --output=./dist/main.js --minify --sourcemap=linked --platform=browser --format=iife ./src/main.ts",
9+
"dependencies": ["build-dictionary"]
910
},
1011
"start": {
11-
"description": "Starts a development server. The provided page will auto-reload whenever there are changes to the code.",
12-
"command": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./build/dev.ts"
12+
"description": "Starts a development server which automatically rebuilds the project whenever there are changes to the code. However, there is no server that serves frontend and you have to manually refresh the page.",
13+
"command": "(trap 'kill 0' SIGINT; deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only --watch --no-clear-screen ./dictionary/watch.ts & deno bundle --output=./dist/main.js --sourcemap=linked --platform=browser --format=iife --watch ./src/main.ts)",
14+
"dependencies": ["soft-build-dictionary"]
1315
},
1416
"repl": {
1517
"description": "Starts a REPL",
@@ -19,6 +21,10 @@
1921
"build-dictionary": {
2022
"description": "Builds the dictionary at `./dictionary/dictionary.ts`",
2123
"command": "deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/build.ts"
24+
},
25+
"soft-build-dictionary": {
26+
"description": "Only builds the dictionary at `./dictionary/dictionary.ts` when it exists. When an error occurs, an empty dictionary is provided.",
27+
"command": "deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary,./dictionary/dictionary.ts -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/soft-build.ts"
2228
}
2329
},
2430
"fmt": {
@@ -53,7 +59,6 @@
5359
}
5460
},
5561
"imports": {
56-
"@luca/esbuild-deno-loader": "jsr:@luca/esbuild-deno-loader@^0.11.1",
5762
"@std/assert": "jsr:@std/assert@^1.0.14",
5863
"@std/async": "jsr:@std/async@^1.0.14",
5964
"@std/cache": "jsr:@std/cache@^0.2.0",
@@ -64,7 +69,6 @@
6469
"@std/regexp": "jsr:@std/regexp@^1.0.1",
6570
"@std/text": "jsr:@std/text@^1.0.16",
6671
"browser-dtector": "npm:browser-dtector@^4.1.0",
67-
"compromise": "npm:compromise@^14.14.4",
68-
"esbuild": "npm:esbuild@^0.25.9"
72+
"compromise": "npm:compromise@^14.14.4"
6973
}
7074
}

0 commit comments

Comments
 (0)