Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit e74aa2a

Browse files
committed
🐛 fixes dependency injection when using an esbuild toolchain
1 parent 7b1072a commit e74aa2a

2 files changed

Lines changed: 31 additions & 6 deletions

File tree

jovo.build.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { build } = require('esbuild');
2+
const { esbuildDecorators } = require('@anatine/esbuild-decorators');
3+
4+
5+
build({
6+
platform: 'node',
7+
target: 'node14',
8+
bundle: true,
9+
sourcemap: true,
10+
minify: true,
11+
keepNames: true,
12+
format: 'cjs',
13+
tsconfig: __dirname + '/tsconfig.json',
14+
entryPoints: [process.argv[2]],
15+
outfile: __dirname + '/bundle/index.js',
16+
external: ['aws-sdk', '@oclif/:*', '@jovotech/cli*', '@alexa/*'],
17+
plugins: [
18+
esbuildDecorators({
19+
tsconfig: __dirname + '/tsconfig.json',
20+
cwd: process.cwd(),
21+
}),
22+
],
23+
});

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@
99
"test": "jest",
1010
"tsc": "tsc",
1111
"start:dev": "tsc-watch --onSuccess \"node ./dist/app.dev.js --jovo-webhook\" --noClear",
12-
"bundle": "esbuild --bundle --outfile=bundle/index.js --sourcemap --minify --keep-names --platform=node --target=node14 --format=cjs --external:aws-sdk --external:@oclif/* --external:@jovotech/cli*",
12+
"bundle": "node ./jovo.build.js",
1313
"prebundle": "rimraf bundle",
1414
"postbundle": "cd bundle && bestzip ../bundle.zip * && cd ..",
1515
"bundle:dev": "npm run bundle -- src/app.dev.ts",
1616
"eslint": "eslint src test --fix --ext .ts"
1717
},
1818
"dependencies": {
19-
"@jovotech/db-filedb": "^4.0.0",
20-
"@jovotech/framework": "^4.0.0",
21-
"@jovotech/plugin-debugger": "^4.0.0",
22-
"@jovotech/server-express": "^4.0.0",
23-
"source-map-support": "^0.5.19"
19+
"@jovotech/db-filedb": "^4.5.0",
20+
"@jovotech/framework": "^4.5.0",
21+
"@jovotech/plugin-debugger": "^4.5.0",
22+
"@jovotech/server-express": "^4.5.0",
23+
"source-map-support": "^0.5.19",
24+
"tslib": "^2.4.1"
2425
},
2526
"devDependencies": {
27+
"@anatine/esbuild-decorators": "^0.2.19",
2628
"@jovotech/cli-core": "^4.0.0",
2729
"@types/express": "^4.17.11",
2830
"@types/jest": "^27.0.2",

0 commit comments

Comments
 (0)