-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
62 lines (61 loc) · 1.72 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
const path = require('path');
const webpack = require("webpack");
const current_mode = process.env.STREAMTIDE_ENV in ['prod', 'qa'] ? 'production' : 'development';
module.exports = {
entry: './target/index.js',
output: {
filename: 'libs.js',
path: path.resolve(__dirname, 'resources', 'public', 'js'),
},
externals: {
"react-native": true,
},
resolve: {
alias: {
'../react/web/ui/MediaRenderer/MediaRenderer.js' : false,
},
fallback: {
"fs": false,
"tls": false,
"net": false,
"path": false,
"zlib": false,
"http": false,
"https": false,
"stream": require.resolve("stream-browserify"),
"os": false,
"crypto": false,
"buffer": require.resolve("buffer"),
"process/browser": require.resolve('process/browser'),
"vm": false
}
},
module: {
rules: [
{
test: /NetworkSelector\.js$/,
loader: 'string-replace-loader',
options: {
search: '(const fuse_js_1 =.*)',
replace(match, p1) {
return `${p1} fuse_js_1.default = fuse_js_1;`
},
flags: 'g'
}
},
{
test: /\.(sass|css)$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser'
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
mode: current_mode
};