Switch to webpack

This commit is contained in:
ochafik 2023-03-25 19:30:34 +00:00
commit 4b11073437
17 changed files with 238 additions and 69 deletions

View file

@ -4,6 +4,19 @@ WIP revamp of https://github.com/ochafik/openscad-wasm/tree/editor-ochafik.com /
Licenses: see [LICENSES](./LICENSES).
## Features
- Automatic preview on edit (F5), and full rendering on Ctrl+Enter (or F6)
- Syntax highlighting
- Ships with many standard SCAD libraries
- Autocomplete of imports
- Autocomplete of symbols / function calls (pseudo-parses file and its transitive imports)
-
## TODO
- Investigate https://www.npmjs.com/package/react-codemirror for mobile editor (Monaco on iOS is terribly broken)
- Link to https://www.npmjs.com/package/monaco-languages MIT JS source for language
## Build
Prerequisites:
@ -12,14 +25,23 @@ Prerequisites:
* npm
* deno
Local dev:
```bash
make clean
# When doing local development, ensure the import.meta.url is replaced to localhost:
# (otherwise will get cryptic `RangeError: WebAssembly.Table.get(): invalid index 999948 into function table`)
dev=1 make public
make public
npm start
# http://localhost:4000/
```
make public
npm run start:prod
# http://localhost:3000/dist/
# When building a release
make
```
Deployment (edit "homepage" in `package.json` to match your deployment root!):
```bash
make public
npm build
rm -fR ../ochafik.github.io/openscad2 && cp -R dist ../ochafik.github.io/openscad2
# Now commit and push changes, wait for site update and enjoy!
```