Skip to content

Commit

Permalink
fix bundle test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Jan 5, 2024
1 parent ef85732 commit 44103f0
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Blockchains from '@depay/web3-blockchains'
import DePayWidgets from '../../dist/umd/index.bundle'
import DePayWidgets from '../../dist/esm/index.bundle'
import fetch from 'cross-fetch'
import fetchMock from 'fetch-mock'
import mockBasics from '../../tests/mocks/evm/basics'
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@
"babel-loader": "^9.1.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"buffer": "^6.0.3",
"cross-fetch": "^3.1.5",
"crypto-browserify": "^3.12.0",
"cypress": "^10.11.0",
"eslint": "^7.15.0",
"eslint-loader": "^4.0.2",
Expand All @@ -91,6 +93,7 @@
"ethers": "^5.7.1",
"fetch-mock": "^9.11.0",
"mock-socket": "^9.0.8",
"process": "^0.11.10",
"react": "^18",
"react-dom": "^18",
"regenerator-runtime": "^0.13.7",
Expand All @@ -103,6 +106,7 @@
"rollup-plugin-polyfill-node": "^0.7.0",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"stream-browserify": "^3.0.0",
"typescript": "^5.0.2",
"util": "0.10.0",
"webpack": "^5.73.0"
Expand Down
12 changes: 12 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');

module.exports = {
mode: 'development',
Expand All @@ -18,7 +19,18 @@ module.exports = {
},
],
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
fallback: {
"crypto": require.resolve("crypto-browserify"),
"process": require.resolve("process/browser"),
"stream": require.resolve("stream-browserify"),
"buffer": require.resolve("buffer/")
}
},
};
Loading

0 comments on commit 44103f0

Please sign in to comment.