Skip to content

Commit ed70fcb

Browse files
committed
allow web build
1 parent 60b5438 commit ed70fcb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/webpack.web.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ module.exports = (env, argv) => {
5050
new webpack.IgnorePlugin({
5151
resourceRegExp: /ps-list/, // matches the path in the require() statement
5252
}),
53+
/**
54+
* HACK: the glob module breaks Web mode if imported, BUT we still dynamically import this module for non web mode
55+
* environments. The following allows compilation to pass by never bundling the module in the final output for web mode.
56+
*/
57+
new webpack.IgnorePlugin({
58+
resourceRegExp: /glob/, // matches the path in the require() statement
59+
}),
5360
],
5461
resolve: {
5562
extensions: ['.ts', '.js'],
@@ -76,6 +83,10 @@ module.exports = (env, argv) => {
7683
child_process: false, // Reason for error: 'TypeError: The "original" argument must be of type Function'
7784
async_hooks: false,
7885
net: false,
86+
87+
// codewhisperer chat imports jsdom which doesn't run in web mode
88+
vm: false,
89+
tls: false,
7990
},
8091
},
8192
optimization: {

0 commit comments

Comments
 (0)