Skip to content

Commit 3576b6a

Browse files
committed
feat: support single executable js file build
1 parent 9682350 commit 3576b6a

3 files changed

Lines changed: 730 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ coverage/
1919
.pnp.*
2020
.yarn/sdks/
2121

22+
23+
dist/

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
"start": "node core",
1111
"dev": "yarn nodemon core.js -D",
1212
"pnpify": "yarn dlx @yarnpkg/pnpify",
13+
"build:": "esbuild --bundle --minify --platform=node --outfile=dist/server.js core.js",
1314
"lint": "eslint ./src/**/*.js ./adapter/**/*.js ./test/**/*.js core.js",
1415
"watch": "yarn dlx supervisor --watch \".\" --extensions \"js,json\" --exec \"yarn\" -- \"start\"",
1516
"test": "jest --verbose",
1617
"commit": "yarn dlx git-cz",
1718
"release": "yarn dlx release-it",
1819
"changelog": "yarn dlx -p conventional-changelog-cli conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 0 -n .changelog.config.js",
1920
"prepare": "husky install",
20-
"postinstall": "sh -c 'if [ command -v ./node_modules/.bin/husky ]; then ./node_modules/.bin/husky install; fi;'"
21+
"postinstall": "husky install"
2122
},
2223
"repository": "https://github.com/hitokoto-osc/hitokoto-api",
2324
"author": "a632079 <a632079@qq.com>",
@@ -44,6 +45,7 @@
4445
"commitizen": "4.3.0",
4546
"conventional-changelog-conventionalcommits": "7.0.2",
4647
"cz-conventional-changelog": "3.3.0",
48+
"esbuild": "^0.19.5",
4749
"eslint": "8.53.0",
4850
"eslint-config-prettier": "9.0.0",
4951
"eslint-config-standard": "17.1.0",
@@ -63,7 +65,8 @@
6365
"regenerator-runtime": "0.13.11",
6466
"release-it": "16.1.0",
6567
"supertest": "6.3.3",
66-
"supervisor": "0.12.0"
68+
"supervisor": "0.12.0",
69+
"webpack": "^5.89.0"
6770
},
6871
"dependencies": {
6972
"@hitokoto/koa-jsonp": "3.0.7",

0 commit comments

Comments
 (0)