nornagon / saxi

Tools & library for driving the AxiDraw pen plotter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Esbuild investigation

jedahan opened this issue · comments

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.

Setting to IS_WEB=0 fixes the navigator.serial error (not using webserial to connect this)

I got esbuild working, which allows saxi to be built on a raspberry pi as webpack OOMs even with 1.5Gb. PR is #186