Serve minified version.

This commit is contained in:
Paul Holden 2023-09-26 09:10:42 +01:00
parent d4cdf03d44
commit ccd8ee6064
5 changed files with 549 additions and 8 deletions

4
.gitignore vendored
View file

@ -1,9 +1,5 @@
.DS_Store
build/
bun.lockb
local-notes.md
n64.min.js
n64.min.js.map
n64js.sublime-workspace
node_modules/
package-lock.json

View file

@ -10,7 +10,25 @@ Mostly for the challenge. I've spent ~25 years (on and off) working on N64 emula
A hosted version is available on GitHub pages at https://hulkholden.github.io/n64js/.
If you want to run it locally, just run `python3 -m http.server` or equivalent in the root directory and navigate to http://localhost:8000/.
## Development
Install `bun`': https://bun.sh/.
Compile sources (pass --watch to automatically recompile on any change):
```
bun run build --watch
```
Run a local webserver in the root directory:
```
python3 -m http.server
```
Navigate to http://localhost:8000/.
If you want to run without installing bun, you can change the importmap in index.html to point at src/n64.js instead of build/n64.min.js.
## Compatibility

527
build/n64.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -448,7 +448,7 @@
<script src="js/md5.js"></script>
<script src="js/stats.js"></script>
<script src="js/webgl-debug.js"></script>
<script type="module" src="src/n64.js"></script>
<script type="module" src="build/n64.min.js"></script>
<script id="fill-shader-vs" type="x-shader/x-vertex">
attribute vec4 aVertexPosition;

View file

@ -5,8 +5,8 @@
"main": "n64.min.js",
"type": "module",
"scripts": {
"build": "bun build ./src/n64.js --outfile=n64.js",
"build-minify": "bun build --minify ./src/n64.min.js --outfile=n64.min.js --sourcemap"
"build": "bun build ./src/n64.js --outfile=build/n64.min.js --minify",
"build-debug": "bun build ./src/n64.js --outfile=build/n64.min.js --sourcemap --minify"
},
"repository": {
"type": "git",