add dynabridge and support specific bundled modules
This commit is contained in:
parent
d80cd34a88
commit
e3b8acb8a9
@ -11,19 +11,21 @@
|
|||||||
"deploy": "twilio-run deploy --load-system-env --env .env.example --service-name doorman --environment=prod --override-existing-project"
|
"deploy": "twilio-run deploy --load-system-env --env .env.example --service-name doorman --environment=prod --override-existing-project"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-dynamodb": "^3.609.0",
|
"@aws-sdk/client-dynamodb": "^3.821.0",
|
||||||
"@twilio-labs/serverless-runtime-types": "^4.0.1",
|
"@twilio-labs/serverless-runtime-types": "^4.0.1",
|
||||||
"@twilio/runtime-handler": "1.3.0",
|
"@twilio/runtime-handler": "1.3.0",
|
||||||
"discord.js": "^14.16.3",
|
"discord.js": "^14.19.3",
|
||||||
|
"dynabridge": "^0.3.8",
|
||||||
"prom-client": "^15.1.3",
|
"prom-client": "^15.1.3",
|
||||||
"promise.timeout": "^1.2.0",
|
"promise.timeout": "^1.2.0",
|
||||||
"twilio": "^3.56",
|
"twilio": "^3.84.1",
|
||||||
"winston": "^3.17.0",
|
"winston": "^3.17.0",
|
||||||
"winston-loki": "^6.1.3"
|
"winston-loki": "^6.1.3",
|
||||||
|
"zod": "^3.25.42"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"twilio-run": "^3.5.4",
|
"twilio-run": "^3.5.4",
|
||||||
"concurrently": "^9.1.0"
|
"concurrently": "^9.1.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18"
|
"node": "18"
|
||||||
|
|||||||
@ -12,12 +12,24 @@ const imports = functionFiles.forEach(file => require('./' + path.relative('src'
|
|||||||
|
|
||||||
console.log("functions to build:", functionFiles);
|
console.log("functions to build:", functionFiles);
|
||||||
|
|
||||||
|
const bundledModules = ['dynabridge'];
|
||||||
|
|
||||||
|
const externalModules = Object.keys(require('../package.json').dependencies)
|
||||||
|
.filter(dep => !bundledModules.includes(dep));
|
||||||
|
|
||||||
|
console.log("Explicitly bundling dependencies", bundledModules);
|
||||||
|
|
||||||
|
// console.log("external modules: ", externalModules);
|
||||||
|
|
||||||
console.log("Building functions...");
|
console.log("Building functions...");
|
||||||
|
|
||||||
await Bun.build({
|
await Bun.build({
|
||||||
entrypoints: functionFiles,
|
entrypoints: functionFiles,
|
||||||
outdir: './build/functions',
|
outdir: './build/functions',
|
||||||
packages: 'external',
|
packages: 'bundle',
|
||||||
target: 'node',
|
target: 'node',
|
||||||
|
// mark all deps as external EXCEPT for dynabridge, because we need to transpile it for CJS
|
||||||
|
external: externalModules,
|
||||||
root: './src/functions',
|
root: './src/functions',
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user