Compare commits

...

3 Commits

Author SHA1 Message Date
Cris Stringfellow 56041a630a
Build minification and analysis works. I LOVE esbuild! 2023-01-13 19:15:07 +08:00
Cris Stringfellow 81c3fae639
Build updates 2023-01-13 18:48:30 +08:00
Cris Stringfellow be336f1c10
Pkg update 2023-01-13 18:17:32 +08:00
3 changed files with 22 additions and 13 deletions

View File

@ -4,27 +4,28 @@
"type": "module",
"description": "Library server and an archivist browser controller.",
"main": "src/app.js",
"module": "module/22120-module.js",
"module": "dist/diskernet.js",
"bin": {
"diskernet": "build/out.cjs"
"diskernet": "build/diskernet.cjs"
},
"scripts": {
"start": "node src/app.js",
"setup": "bash ./scripts/build_setup.sh",
"build": "echo Ensure you 'npm run setup' first && bash ./scripts/compile.sh",
"compile": "npm run build",
"build-only": "bash ./scripts/build_only.sh",
"clean": "rm -rf build/* bin/*",
"super-clean": "npm run clean || : && rm -rf node_modules || : && rm package-lock.json",
"test": "nodemon src/app.js",
"save": "nodemon src/app.js 22120 save",
"serve": "nodemon src/app.js 22120 serve",
"save": "nodemon src/app.js DiskerNet save",
"serve": "nodemon src/app.js DiskerNet serve",
"lint": "watch -n 5 npx eslint .",
"test-hl": "node src/highlighter.js",
"postpublish": "cp package.json .package.build.json",
"prepublishOnly": "./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node"
"prepublishOnly": "npm run build-only"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dosyago/22120.git"
"url": "git+https://github.com/dosyago/DiskerNet.git"
},
"pkg": {
"scripts": "build/**/*.js",
@ -38,11 +39,11 @@
"library"
],
"author": "@dosy",
"license": "AGPL-3.0",
"license": "PolyForm Strict 1.0",
"bugs": {
"url": "https://github.com/dosyago/22120/issues"
"url": "https://github.com/dosyago/DiskerNet/issues"
},
"homepage": "https://github.com/dosyago/22120#readme",
"homepage": "https://github.com/dosyago/DiskerNet#readme",
"dependencies": {
"chrome-launcher": "latest",
"express": "latest",

8
scripts/build_only.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
./node_modules/.bin/esbuild src/app.js --bundle --outfile=dist/diskernet.mjs --format=esm --platform=node --minify --analyze
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node --minify --analyze
echo "#!/usr/bin/env node" > build/diskernet.js
cat build/out.cjs >> build/diskernet.js
chmod +x build/diskernet.js

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash
./scripts/build_only.sh
unset npm_config_prefix
source $HOME/.nvm/nvm.sh
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node
nvm use --lts
pkg --compress GZip .