mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: mature build script
This commit is contained in:
1 parent
4be7852bf3
commit
c685f86dc4
4 files changed
+27
-6
No files matched your search
@@ -44,4 +44,4 @@ jobs:
|
|||||||
run: yarn
|
run: yarn
|
||||||
|
|
||||||
- name: Host
|
- name: Host
|
||||||
run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} yarn dev --dev
|
run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} yarn dev
|
||||||
Vendored
+1
@@ -6,6 +6,7 @@
|
|||||||
"cleandist",
|
"cleandist",
|
||||||
"fuzzysort",
|
"fuzzysort",
|
||||||
"kranvagn",
|
"kranvagn",
|
||||||
|
"outfile",
|
||||||
"ownedtanks",
|
"ownedtanks",
|
||||||
"Resvg",
|
"Resvg",
|
||||||
"searchplayers",
|
"searchplayers",
|
||||||
|
|||||||
+2
-5
@@ -6,11 +6,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "yarn build && yarn start",
|
"dev": "yarn build && yarn start",
|
||||||
"start": "node --enable-source-maps dist/server.cjs",
|
"start": "node --enable-source-maps dist/index.cjs",
|
||||||
"cleandist": "rm -rf dist",
|
"build": "node scripts/build",
|
||||||
"build:raw": "npx esbuild src/index.ts --outfile=dist/server.cjs --platform=node --bundle --sourcemap --loader:.node=copy --loader:.ttf=file",
|
|
||||||
"build:package": "cp package.dist.json dist/package.json",
|
|
||||||
"build": "yarn cleandist && yarn build:raw && yarn build:package",
|
|
||||||
"lint": "tsc"
|
"lint": "tsc"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { build } from 'esbuild';
|
||||||
|
import { rmSync } from 'fs';
|
||||||
|
|
||||||
|
console.log('Removing dist...');
|
||||||
|
rmSync('dist', { recursive: true, force: true });
|
||||||
|
|
||||||
|
console.log('Creating context...');
|
||||||
|
build({
|
||||||
|
entryPoints: ['src/index.ts'],
|
||||||
|
outfile: 'dist/index.cjs',
|
||||||
|
|
||||||
|
platform: 'node',
|
||||||
|
loader: {
|
||||||
|
'.node': 'copy',
|
||||||
|
'.ttf': 'file',
|
||||||
|
},
|
||||||
|
|
||||||
|
bundle: true,
|
||||||
|
sourcemap: true,
|
||||||
|
minifyIdentifiers: false, // causes errors
|
||||||
|
minifySyntax: true,
|
||||||
|
minifyWhitespace: true,
|
||||||
|
});
|
||||||
Reference in new issue
Block a user