diff --git a/package-lock.json b/package-lock.json index e52299376..6e1207efb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14009,6 +14009,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", @@ -14048,7 +14049,7 @@ "eslint": "8.57.1", "jest": "29.7.0", "npm-run-all": "4.1.5", - "rimraf": "^6.0.1", + "rimraf": "6.0.1", "ts-jest": "29.2.5" }, "engines": { diff --git a/packages/concerto-cto/package.json b/packages/concerto-cto/package.json index c62e88af4..05b437c86 100644 --- a/packages/concerto-cto/package.json +++ b/packages/concerto-cto/package.json @@ -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", diff --git a/packages/concerto-cto/webpack.config.js b/packages/concerto-cto/webpack.config.js index cdc2603e6..ea8b7ee51 100644 --- a/packages/concerto-cto/webpack.config.js +++ b/packages/concerto-cto/webpack.config.js @@ -16,6 +16,7 @@ let path = require('path'); const webpack = require('webpack'); +const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const packageJson = require('./package.json'); @@ -45,6 +46,7 @@ module.exports = { 'NODE_ENV': JSON.stringify('production') } }), + new NodePolyfillPlugin(), ], module: { rules: [ @@ -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'), } } -}; \ No newline at end of file +};