Skip to content

Commit

Permalink
fix: bundle build for container (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten authored Sep 12, 2022
1 parent 3fc1aff commit 4eb139c
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 11 deletions.
18 changes: 18 additions & 0 deletions contrib/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** eslint-env node */
import esbuild from 'esbuild';
import path from 'path';

esbuild
.build({
entryPoints: [path.join(__dirname, '..', 'src', 'index.ts')],
outfile: path.join(__dirname, '..', 'dist', 'index.js'),
platform: 'node',
bundle: true,
minify: process.env.node_env === 'production',
external: [],
sourcemap: true,
tsconfig: path.join(__dirname, '..', 'tsconfig.json'),
})
.catch(() => {
process.exit(1);
});
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"oauth-mock-server": "./dist/index.js"
},
"scripts": {
"build": "tsup src/index.ts --dts --format cjs,esm",
"build": "tsx contrib/build.ts",
"clean": "rm -rf dist/ node_modules/",
"lint": "eslint --max-warnings 0 .",
"lint:format": "prettier --check .",
"start": "pnpm run build --watch",
"start": "pnpm tsup src/index.ts --dts --format cjs,esm --watch",
"test": "vitest run --coverage",
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
Expand All @@ -43,6 +43,7 @@
"@geprog/semantic-release-config": "1.0.0",
"@types/jsonwebtoken": "8.5.8",
"c8": "7.11.3",
"esbuild": "0.15.7",
"eslint": "8.8.0",
"prettier": "2.5.1",
"semantic-release": "19.0.2",
Expand Down
Loading

0 comments on commit 4eb139c

Please sign in to comment.