Skip to content

Commit

Permalink
fix(utils): fix browser build for concerto-util
Browse files Browse the repository at this point in the history
Signed-off-by: sanketshevkar <shevkar.sanket@gmail.com>
  • Loading branch information
sanketshevkar committed Dec 12, 2024
1 parent 33acf3e commit 87ee209
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/concerto-cto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"eslint": "8.57.1",
"jsdoc": "^4.0.4",
"mocha": "10.8.2",
"node-polyfill-webpack-plugin": "4.0.0",
"nyc": "17.1.0",
"peggy": "4.2.0",
"sinon": "19.0.2",
Expand Down
17 changes: 15 additions & 2 deletions packages/concerto-cto/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

let path = require('path');
const webpack = require('webpack');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

const packageJson = require('./package.json');

Expand Down Expand Up @@ -45,6 +46,7 @@ module.exports = {
'NODE_ENV': JSON.stringify('production')
}
}),
new NodePolyfillPlugin(),
],
module: {
rules: [
Expand All @@ -64,7 +66,18 @@ module.exports = {
// Webpack 5 no longer polyfills Node.js core modules automatically.
// see https://webpack.js.org/configuration/resolve/#resolvefallback
// for the list of Node.js core module polyfills.
'path': 'path-browserify'
'fs': false,
'tls': false,
'net': false,
'child_process': false,
'os': false,
'path': false,
// 'crypto': require.resolve('crypto-browserify'),
// 'stream': require.resolve('stream-browserify'),
// 'http': require.resolve('stream-http'),
// 'https': require.resolve('https-browserify'),
// 'zlib': require.resolve('browserify-zlib'),
// 'vm2': require.resolve('vm-browserify'),
}
}
};
};

0 comments on commit 87ee209

Please sign in to comment.