Skip to content

Commit ce17005

Browse files
Copilotrubensworks
andcommitted
Fix webpack web bundle crash on Windows: use DefinePlugin to set process.platform to 'browser'
Agent-Logs-Url: https://github.com/LinkedSoftwareDependencies/Components.js/sessions/564588ce-af32-4dca-b68b-2522414fed80 Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent 4e2cb2b commit ce17005

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/webpack/webpack.config-web.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require('path');
2+
const webpack = require('webpack');
23
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
34

45
module.exports = [
@@ -24,7 +25,10 @@ module.exports = [
2425
modules: ['node_modules', path.resolve(__dirname, 'node_modules')],
2526
},
2627
plugins: [
27-
new NodePolyfillPlugin()
28+
new NodePolyfillPlugin(),
29+
new webpack.DefinePlugin({
30+
'process.platform': JSON.stringify('browser'),
31+
}),
2832
],
2933
resolve: {
3034
fallback: {

0 commit comments

Comments
 (0)