esbuild for compile/bundle ts
This commit is contained in:
parent
90b2890664
commit
c8670bfe65
16
esbuild.mjs
Normal file
16
esbuild.mjs
Normal 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));
|
11
package.json
11
package.json
@ -7,7 +7,7 @@
|
|||||||
"start": "node ./dist/app.js",
|
"start": "node ./dist/app.js",
|
||||||
"dev": "npx ts-node -r tsconfig-paths/register ./src/app.ts",
|
"dev": "npx ts-node -r tsconfig-paths/register ./src/app.ts",
|
||||||
"build": "sh ./scripts/build.sh",
|
"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: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",
|
"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",
|
"db:migrate": "npx prisma migrate dev --name",
|
||||||
@ -23,6 +23,8 @@
|
|||||||
"@types/jquery": "^3.5.32",
|
"@types/jquery": "^3.5.32",
|
||||||
"@types/node": "^22.14.1",
|
"@types/node": "^22.14.1",
|
||||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
|
"esbuild": "^0.25.2",
|
||||||
|
"fast-glob": "^3.3.3",
|
||||||
"nodemon": "^3.1.9",
|
"nodemon": "^3.1.9",
|
||||||
"prisma": "^6.6.0",
|
"prisma": "^6.6.0",
|
||||||
"tailwindcss": "^4.1.4",
|
"tailwindcss": "^4.1.4",
|
||||||
@ -32,12 +34,17 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.6.0",
|
"@prisma/client": "^6.6.0",
|
||||||
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
|
"discord.js": "^14.18.0",
|
||||||
"dotenv": "^16.5.0",
|
"dotenv": "^16.5.0",
|
||||||
"ejs": "^3.1.10",
|
"ejs": "^3.1.10",
|
||||||
"ejs-mate": "^4.0.0",
|
"ejs-mate": "^4.0.0",
|
||||||
"express": "^5.1.0",
|
"express": "^5.1.0",
|
||||||
|
"jquery": "^3.7.1",
|
||||||
|
"preline": "^3.0.1",
|
||||||
"sqlite3": "^5.1.7",
|
"sqlite3": "^5.1.7",
|
||||||
"tsconfig-paths": "^4.2.0"
|
"tsconfig-paths": "^4.2.0",
|
||||||
|
"vanilla-calendar-pro": "^3.0.4"
|
||||||
},
|
},
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "ts-node prisma/seed.ts"
|
"seed": "ts-node prisma/seed.ts"
|
||||||
|
669
src/client/public/js/main.js
Normal file
669
src/client/public/js/main.js
Normal file
File diff suppressed because one or more lines are too long
@ -3,7 +3,8 @@
|
|||||||
"target": "ES5",
|
"target": "ES5",
|
||||||
"outDir": "./public/js",
|
"outDir": "./public/js",
|
||||||
"rootDir": "./typescript",
|
"rootDir": "./typescript",
|
||||||
"sourceMap": false
|
"sourceMap": false,
|
||||||
|
"esModuleInterop": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./typescript/**/*"
|
"./typescript/**/*"
|
||||||
|
7
src/client/typescript/main.ts
Normal file
7
src/client/typescript/main.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { HSOverlay } from 'preline';
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
|
$(document).ready(() => {
|
||||||
|
console.log("ready!");
|
||||||
|
HSOverlay;
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user