forked from SecuX/secux-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
63 lines (58 loc) · 1.6 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
const webpack = require('webpack');
const definePluginConfig = new webpack.DefinePlugin({
'process.env.DISTRIBUTION': JSON.stringify('development'),
'process.env.LOGGER': JSON.stringify('winston'),
// 'process.env.SECUX_CONFIRM': JSON.stringify('off')
});
const nodepolyfillPlugin = new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
});
module.exports = {
output: {
path: `${__dirname}/__tests__`,
filename: 'index.js',
libraryTarget: 'umd'
},
devServer: {
compress: true,
port: 8080,
static: './__tests__'
},
devtool: 'inline-source-map',
plugins: [definePluginConfig, nodepolyfillPlugin],
mode: 'development',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
externals: {
"react-native-logs": "react-native-logs"
},
resolve: {
extensions: ['.ts', '.js'],
fallback: {
buffer: require.resolve('buffer/'),
process: require.resolve('process'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
fs: false,
tls: false,
net: false,
path: false,
os: false,
http: false,
https: require.resolve('agent-base'),
zlib: false,
querystring: require.resolve("querystring-es3"),
}
},
experiments: {
asyncWebAssembly: true
}
}