Skip to content

Commit aef7053

Browse files
committed
dont use web imports
1 parent 8d8c5c5 commit aef7053

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/webpack.web.config.js

Lines changed: 12 additions & 1 deletion
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 node: prefix'd modules 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: /^node:/, // Ignores all node: protocol imports
59+
}),
5360
],
5461
resolve: {
5562
extensions: ['.ts', '.js'],
@@ -76,10 +83,14 @@ 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,
79-
// lsp starts itself on the "common" activation path for web/node, so these imports need to be ignored on web
86+
// lsp starts itself on the "common" activation path for web/node, these imports are specific to node and should be ignored
8087
vm: false,
8188
tls: false,
8289
glob: false,
90+
'original-fs': false,
91+
canvas: false,
92+
bufferutil: false,
93+
'utf-8-validate': false,
8394
},
8495
},
8596
optimization: {

0 commit comments

Comments
 (0)