-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
81 lines (79 loc) · 1.7 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
mode: 'production',
entry: './src/browser.ts',
output: {
filename: 'nostr-auth-middleware.min.js',
path: path.resolve(__dirname, 'dist/browser'),
library: {
name: 'NostrAuthMiddleware',
type: 'umd',
umdNamedDefine: true
},
globalObject: 'this'
},
resolve: {
extensions: ['.ts', '.js', '.mjs'],
extensionAlias: {
'.js': ['.ts', '.js']
},
alias: {
'@': path.resolve(__dirname, 'src')
},
fallback: {
"os": false,
"fs": false,
"path": false,
"http": false,
"https": false,
"stream": false,
"crypto": false,
"buffer": false,
"util": false,
"zlib": false,
"vm": false,
"assert": false,
"constants": false,
"net": false,
"tls": false,
"child_process": false
}
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /\.d\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.browser.json',
onlyCompileBundledFiles: true,
transpileOnly: true,
compilerOptions: {
module: 'NodeNext',
moduleResolution: 'NodeNext'
}
}
}
],
exclude: /node_modules\/(?!nostr-crypto-utils)/
},
{
test: /\.d\.ts$/,
loader: 'ignore-loader'
}
]
},
optimization: {
minimize: true
},
externals: {
express: 'express',
winston: 'winston'
}
};