forked from LeoPlatform/Nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
57 lines (55 loc) · 1.26 KB
/
webpack.config.ts
File metadata and controls
57 lines (55 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const path = require('path');
const { glob } = require("glob");
module.exports = (async () => {
const entryFiles = (await glob("**/*-task-module.ts", {
ignore: ["node_modules/**", "util-lambdas/**"],
})).reduce((all, file) => {
console.log("File:", file);
all[file.replace(/\.ts$/, "")] = path.resolve(__dirname, file);
return all;
}, {});
console.log(entryFiles);
return {
entry: {
...entryFiles
},
externals: [
/^@aws-sdk\//
],
// Don't include source map for these files
// devtool: 'source-map',
mode: "production",
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{
exclude: [
[
path.resolve(__dirname, ".webpack"),
],
],
loader: "ts-loader",
options: {
experimentalWatchApi: true,
transpileOnly: true,
},
test: /\.(tsx?)$/,
}
],
},
optimization: {
minimize: false, // We do not want to minimize our code. Easier to fix in lambda console.
},
output: {
filename: "[name].js",
libraryTarget: "commonjs",
path: __dirname//path.join(__dirname, ".webpack")
},
resolve: {
cacheWithContext: false,
extensions: [".mjs", ".json", ".ts", ".js"],
symlinks: false,
},
target: "node"
};
})();