Replace the postinstall script that downloaded minified JavaScript libraries (htmx, highlight.js, lunr) with proper npm package management and bundling using esbuild. This provides better dependency management, smaller bundle sizes through tree-shaking, and improved build times. Changes: - Add htmx.org, highlight.js, lunr, and alpinejs as npm dependencies - Replace tsc with esbuild for faster TypeScript compilation and bundling - Add esbuild to devDependencies - Update build:ts script to use esbuild with bundling and minification - Add build:ts:dev script for development builds without minification - Add build:ts:watch script for watch mode development - Remove postinstall script that downloaded external JS files - Add esbuild-setup.md documentation for the new build setup - Create web/src/main.ts as the new entry point for bundled JavaScript This modernizes the frontend build pipeline and reduces reliance on external CDNs during the build process.
27 lines
978 B
JSON
27 lines
978 B
JSON
{
|
|
"name": "bookhoard",
|
|
"version": "1.0.0",
|
|
"description": "A self-hosted ebook management system",
|
|
"scripts": {
|
|
"build:css": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --watch",
|
|
"build:css:prod": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --minify",
|
|
"build:ts": "esbuild web/src/*.ts --bundle --outdir=web/static/main.js --sourcemap --target=es2020 --minify",
|
|
"build:ts:watch": "esbuild web/src/*.ts --bundle --outdir=web/static --sourcemap --watch",
|
|
"build:ts:dev": "esbuild web/src/*.ts --bundle --outdir=web/static --sourcemap --target=es2020"
|
|
},
|
|
"dependencies": {
|
|
"alpinejs": "^3.15.8",
|
|
"lunr": "^2.3.9",
|
|
"htmx.org": "^2.0.8",
|
|
"highlight.js": "^11.11.1"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/forms": "^0.5.11",
|
|
"@tailwindcss/typography": "^0.5.19",
|
|
"autoprefixer": "^10.4.27",
|
|
"tailwindcss": "^3.4.19",
|
|
"typescript": "^5.9.3",
|
|
"esbuild": "^0.27.3"
|
|
}
|
|
}
|