Skip to content

Commit b261d82

Browse files
authored
feat(backend): replace webpack with esbuild (aws-samples#40)
1 parent 9030102 commit b261d82

File tree

4 files changed

+45
-972
lines changed

4 files changed

+45
-972
lines changed

packages/backend/build.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const glob = require("glob");
2+
const { buildSync } = require("esbuild");
3+
4+
const entryPoints = glob.sync("./src/*.ts");
5+
6+
buildSync({
7+
entryPoints,
8+
entryNames: "[name]/app",
9+
bundle: true,
10+
minify: true,
11+
outdir: "dist",
12+
platform: "node",
13+
target: "node14",
14+
logLevel: "info",
15+
});

packages/backend/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"@aws-sdk/util-dynamodb": "3.23.0"
99
},
1010
"scripts": {
11-
"build": "webpack",
11+
"build": "tsc --noEmit && node build.js",
1212
"build:backend": "cd .. && yarn build:backend",
1313
"cdk": "cd .. && yarn cdk"
1414
},
@@ -27,14 +27,10 @@
2727
"@types/node": "^14.14.2",
2828
"@typescript-eslint/eslint-plugin": "4.8.2",
2929
"@typescript-eslint/parser": "4.8.2",
30-
"clean-webpack-plugin": "3.0.0",
30+
"esbuild": "0.12.17",
3131
"eslint": "7.14.0",
3232
"eslint-config-prettier": "6.15.0",
33-
"eslint-webpack-plugin": "2.4.0",
34-
"ts-loader": "8.0.11",
35-
"typescript": "~4.1.2",
36-
"webpack": "5.19.0",
37-
"webpack-cli": "4.4.0"
33+
"typescript": "~4.1.2"
3834
},
3935
"sideEffects": false
4036
}

packages/backend/webpack.config.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)