forked from serverless-dns/serverless-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.fly.cjs
63 lines (54 loc) · 1.25 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const webpack = require("webpack");
module.exports = {
entry: "./src/server-node.js",
target: ["node22", "es2022"],
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,
}),
],
/* externalsType: 'module',
externals: {
'@riaskov/mmap-io': '@riaskov/mmap-io',
},*/
externals: /@riaskov/,
optimization: {
usedExports: true,
minimize: false,
},
experiments: {
outputModule: true,
},
// github.com/webpack/webpack/issues/14072
// see also: src/core/node/config.js
/* node: {
global: true,
__filename: true,
__dirname: true,
},*/
// require missing: github.com/webpack/webpack/issues/16029
// 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
},
*/
};