perf: (productionの)dependenciesから@typesを削除、reversi/bubble-gameをesbuildにする (#13067)

* perf: (productionの)dependenciesから@typesを削除、reversi/bubble-gameをesbuildにする

* fix

* fix
This commit is contained in:
tamaina 2024-01-23 06:36:44 +09:00 committed by GitHub
parent 58ac8bc8e9
commit af2d81a990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 27 deletions

View file

@ -0,0 +1,31 @@
import { build } from "esbuild";
import { globSync } from "glob";
const entryPoints = globSync("./src/**/**.{ts,tsx}");
/** @type {import('esbuild').BuildOptions} */
const options = {
entryPoints,
minify: true,
outdir: "./built/esm",
target: "es2022",
platform: "browser",
format: "esm",
};
if (process.env.WATCH === "true") {
options.watch = {
onRebuild(error, result) {
if (error) {
console.error("watch build failed:", error);
} else {
console.log("watch build succeeded:", result);
}
},
};
}
build(options).catch((err) => {
process.stderr.write(err.stderr);
process.exit(1);
});

View file

@ -13,18 +13,21 @@
}
},
"scripts": {
"build": "npm run ts",
"ts": "npm run ts-esm && npm run ts-dts",
"ts-esm": "tsc --outDir built/esm",
"ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
"watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build\"",
"build": "node ./build.js",
"build:tsc": "npm run tsc",
"tsc": "npm run ts-esm && npm run ts-dts",
"tsc-esm": "tsc --outDir built/esm",
"tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
"watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"typecheck": "tsc --noEmit",
"lint": "pnpm typecheck && pnpm eslint"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/matter-js": "0.19.6",
"@types/node": "20.11.5",
"@types/seedrandom": "3.0.8",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"eslint": "8.56.0",
@ -35,9 +38,9 @@
"built"
],
"dependencies": {
"@types/matter-js": "0.19.6",
"@types/seedrandom": "3.0.8",
"esbuild": "0.19.11",
"eventemitter3": "5.0.1",
"glob": "^10.3.10",
"matter-js": "0.19.0",
"seedrandom": "3.0.5"
}