Esbuild investigation
jedahan opened this issue · comments
Jonathan Dahan commented
Since I was getting OOM running the build, I decided to try esbuild. It seems almost to work, here is what I have so far:
esbuild --bundle src/ui.tsx \
--outfile=dist/ui/main.js \
--tsconfig=tsconfig.web.json \
--loader:.svg=file \
--loader:.worker.js=file \
--sourcemap \
--define:IS_WEB=1
I had to manually add <script src="main.js"></script>
and <link href="main.css" rel="stylesheet" />
to index.html, and copy that over to dist/ui
.
Now the only thing missing is an error "missing navigator.serial" when running the app. Any suggestions welcome.
Jonathan Dahan commented
Setting to IS_WEB=0 fixes the navigator.serial error (not using webserial to connect this)
Jonathan Dahan commented
I got esbuild working, which allows saxi to be built on a raspberry pi as webpack OOMs even with 1.5Gb. PR is #186