From 4737c49ed3ac32ba3a862b7dc10c2098dc9c6f13 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 12 Nov 2025 01:27:33 -0500 Subject: [PATCH] update npm scripts --- .gitignore | 4 +++- bin/bundler.mjs | 4 +++- bin/esbuild.config.mjs | 2 +- package.json | 19 ++++++++++--------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3132d9dc..7abc853e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .DS_Store +.bache .docusaurus .env +alt app.json build data @@ -13,4 +15,4 @@ pack package-lock.json three.js tmp -web/boot/bundle.bin +web/boot/bundle* diff --git a/bin/bundler.mjs b/bin/bundler.mjs index 5bf621fa..3ab7715d 100644 --- a/bin/bundler.mjs +++ b/bin/bundler.mjs @@ -42,7 +42,9 @@ for (const input of inputs) { const { root, prefix, src, dst } = input; if (src && dst) { - if (virtMap.has(dst)) { + if (!fs.existsSync(src)) { + console.log({ src_missing: src }); + } else if (virtMap.has(dst)) { console.log('pre-existing', dst); } else { entries.push({ file: src, virt: dst }); diff --git a/bin/esbuild.config.mjs b/bin/esbuild.config.mjs index 0cb973bb..26a4315a 100644 --- a/bin/esbuild.config.mjs +++ b/bin/esbuild.config.mjs @@ -66,7 +66,7 @@ const rec = { logOverride, minify: isProd, // false for dev, true for prod platform: 'browser', - sourcemap: !isProd, // true for dev, false for prod + sourcemap: false, target: 'es2020', }; diff --git a/package.json b/package.json index 3c508215..406c0036 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "webpack-cli": "^5.1.4" }, "scripts": { - "setup": "npm run setup-mods && npm i && npm run clean && npm run dev -- --alt --dryrun && npm run webpack-ext", + "setup": "npm run setup-mods && npm i && npm run clean && npm run webpack-ext", "setup-mods": "cd mods && npm i", "build": "npm run prebuild && electron-builder", "build-nopublish": "npm run prebuild && electron-builder --publish never", @@ -93,18 +93,17 @@ "build-win-arm": "npm run build -- --win --arm64", "build-mac": "npm run build -- --mac --arm64", "build-mac-intel": "npm run build -- --mac --x64", - "bundle": "npm run dev -- --alt --dryrun && COMPRESS=1 node bin/bundler.mjs bin/bundle-prod.config.json", - "bundle:dev": "npm run dev -- --alt --dryrun && node bin/bundler.mjs", - "bundle:prod": "npm run dev -- --alt --dryrun && node bin/bundler.mjs bin/bundle-prod.config.json", - "clean": "rm -rf alt build data dist src/pack tmp src.old web.old .bcache", + "bundle": "COMPRESS=1 npm run bundle:prod", + "bundle:dev": "node bin/bundler.mjs", + "bundle:prod": "node bin/bundler.mjs bin/bundle-prod.config.json", + "clean": "rm -rf alt build data dist src/pack src.old tmp web.old .bcache", "docs-dev": "docusaurus start --config conf/docusaurus.config.js", "docs-build": "docusaurus build --config conf/docusaurus.config.js", "docs-serve": "docusaurus serve --config conf/docusaurus.config.js", "docs-check": "prettier --config ./conf/prettier.config.js ./docs --check", - "dev": "npm run webpack-ext && gs-app-server --debug --single", - "prod": "npm run webpack-ext && npm run webpack-src prod && gs-app-server", - "prod-pack": "npm run webpack-ext && npm run webpack-src prod && npm run bundle", - "prod-dryrun": "gs-app-server --dryrun", + "dryrun": "gs-app-server --debug --single --alt --dryrun", + "dev": "npm run pack-dev && gs-app-server --debug --single", + "prod": "npm run pack-prod && npm run webpack-src prod && gs-app-server", "start": "npm run prebuild prod && electron .", "start-dev": "npm run prebuild prod && electron . --devel", "start-dbg": "npm run prebuild && electron . --debugg", @@ -114,6 +113,8 @@ "prebuild": "npm run setup && npm run webpack-src prod && node bin/electron-pre.js", "postbuild": "node bin/electron-post.js", "preinstall": "node bin/install-pre.js", + "pack-dev": "npm run dryrun && npm run webpack-src && npm run dryrun && npm run bundle:dev", + "pack-prod": "npm run dryrun && npm run webpack-src prod && npm run dryrun && npm run bundle", "webpack-ext": "npm run webpack-three && npm run webpack-zip", "webpack-src": "node bin/esbuild.config.mjs", "webpack-three": "npx webpack --config bin/webpack-three-esm.js",