-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (38 loc) · 957 Bytes
/
webpack.config.js
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
const fs = require("fs");
const path = require("path");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const WebpackbarPlugin = require("webpackbar");
const files = fs.readdirSync(path.resolve(__dirname, "./serverless"));
const entry = {};
for (const file of files) {
entry[file.split(".")[0]] = path.resolve(__dirname, "./serverless", file);
}
module.exports = {
entry,
mode: "production",
module: {
rules: [
{ test: /\.tsx?$/, loader: "ts-loader" },
],
},
optimization: {
minimize: false,
},
output: {
filename: `[name].js`,
libraryTarget: "commonjs",
path: path.resolve(__dirname, "./dist/serverless/bundles"),
},
plugins: [
new WebpackbarPlugin({
color: "#fa5252",
name: "Serverless (Production)",
}),
new ForkTsCheckerWebpackPlugin(),
],
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
stats: "errors-only",
target: "node",
};