forked from serverless-dns/serverless-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.fly.cjs
46 lines (40 loc) · 922 Bytes
/
webpack.fly.cjs
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
const webpack = require("webpack");
module.exports = {
entry: "./src/server-node.js",
target: ["node", "es2020"],
mode: "production",
// enable devtool in development
// devtool: 'eval-cheap-module-source-map',
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /(\/deno\/.*\.ts$)|(.*-deno\.ts$)|(.*\.deno\.ts$)/,
}),
// stackoverflow.com/a/60325769
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
optimization: {
usedExports: true,
minimize: false,
},
experiments: {
outputModule: true,
},
// github.com/webpack/webpack/issues/13290
// stackoverflow.com/a/68916455
output: {
library: {
type: "module",
},
clean: true,
filename: "fly.mjs",
module: true,
},
/* or, cjs: stackoverflow.com/a/68916455
output: {
filename: "fly.cjs",
clean: true, // empty dist before output
},
*/
};