Skip to content

Commit f2b2583

Browse files
committed
Add swc optimizations
- [x] Bring payload down to 1.8mb. - [x] drop `all.js` use `out.js`
1 parent fabb948 commit f2b2583

File tree

6 files changed

+70106
-122807
lines changed

6 files changed

+70106
-122807
lines changed

examples/miso/.swcrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"jsc": {
3+
"minify": {
4+
"compress": true, // equivalent to {}
5+
"mangle": true
6+
},
7+
}
8+
}

examples/miso/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY= update build
22

3-
all: clean update build
3+
all: clean update build optim
44

55
update:
66
cabal update --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
@@ -9,6 +9,9 @@ build:
99
cabal build --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
1010
cp -v ./dist-newstyle/build/javascript-ghcjs/ghc-9.12.2/miso-todomvc-0.1/x/app/build/app/app.jsexe/all.js .
1111

12+
optim:
13+
bunx swc ./all.js > out.js
14+
1215
serve:
1316
http-server .
1417

0 commit comments

Comments
 (0)