Skip to content

Commit 16e5f11

Browse files
committed
Fix segment webpack bundling
1 parent 5c0d9be commit 16e5f11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const prodConfig = {
3434
"node-rsa": "node-rsa"
3535
},
3636
resolve: {
37+
mainFields: ['main'],
3738
extensions: ['.ts', '.js']
3839
},
3940
module: {
@@ -52,6 +53,7 @@ const prodConfig = {
5253
new webpack.IgnorePlugin({
5354
resourceRegExp: /cpu-features/,
5455
}),
56+
new webpack.IgnorePlugin({ contextRegExp: /node-fetch/, resourceRegExp: /^encoding$/ }),
5557
new CopyPlugin({
5658
patterns: [
5759
{ from: 'src/local-ssh/proxylauncher.bat', to: 'local-ssh/proxylauncher.bat' },
@@ -81,6 +83,7 @@ const devConfig = {
8183
"node-rsa": "node-rsa"
8284
},
8385
resolve: {
86+
mainFields: ['main'],
8487
extensions: ['.ts', '.js']
8588
},
8689
module: {
@@ -93,6 +96,7 @@ const devConfig = {
9396
}]
9497
},
9598
plugins: [
99+
new webpack.IgnorePlugin({ contextRegExp: /node-fetch/, resourceRegExp: /^encoding$/ }),
96100
new CopyPlugin({
97101
patterns: [
98102
{ from: 'src/local-ssh/proxylauncher.bat', to: 'local-ssh/proxylauncher.bat' },

0 commit comments

Comments
 (0)