esbuild for compile/bundle ts

This commit is contained in:
Corban-Lee Jones 2025-04-22 12:19:09 +01:00
parent 90b2890664
commit c8670bfe65
5 changed files with 703 additions and 3 deletions

16
esbuild.mjs Normal file
View File

@ -0,0 +1,16 @@
import { build } from "esbuild";
import glob from "fast-glob";
const entryPoints = await glob("./src/client/typescript/**/*");
build({
entryPoints,
// outBase: "",
outdir: "./src/client/public/js",
bundle: true,
target: ["es6"],
format: "iife",
sourcemap: false,
loader: {".ts": "ts"},
minify: true
}).catch(() => process.exit(1));

View File

@ -7,7 +7,7 @@
"start": "node ./dist/app.js",
"dev": "npx ts-node -r tsconfig-paths/register ./src/app.ts",
"build": "sh ./scripts/build.sh",
"build:client": "npx tsc -p ./src/client/tsconfig.json",
"build:client": "node esbuild.mjs",
"build:server": "npx tsc -p ./tsconfig.json",
"build:tailwind": "npx @tailwindcss/cli -i ./src/client/public/css/main.css -o ./src/client/public/css/tailwind.css",
"db:migrate": "npx prisma migrate dev --name",
@ -23,6 +23,8 @@
"@types/jquery": "^3.5.32",
"@types/node": "^22.14.1",
"@zerollup/ts-transform-paths": "^1.7.18",
"esbuild": "^0.25.2",
"fast-glob": "^3.3.3",
"nodemon": "^3.1.9",
"prisma": "^6.6.0",
"tailwindcss": "^4.1.4",
@ -32,12 +34,17 @@
},
"dependencies": {
"@prisma/client": "^6.6.0",
"@tailwindcss/forms": "^0.5.10",
"discord.js": "^14.18.0",
"dotenv": "^16.5.0",
"ejs": "^3.1.10",
"ejs-mate": "^4.0.0",
"express": "^5.1.0",
"jquery": "^3.7.1",
"preline": "^3.0.1",
"sqlite3": "^5.1.7",
"tsconfig-paths": "^4.2.0"
"tsconfig-paths": "^4.2.0",
"vanilla-calendar-pro": "^3.0.4"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,8 @@
"target": "ES5",
"outDir": "./public/js",
"rootDir": "./typescript",
"sourceMap": false
"sourceMap": false,
"esModuleInterop": true
},
"include": [
"./typescript/**/*"

View File

@ -0,0 +1,7 @@
import { HSOverlay } from 'preline';
import $ from 'jquery';
$(document).ready(() => {
console.log("ready!");
HSOverlay;
});