File tree
Expand file treeCollapse file tree2 files changed
+25
-12
lines changed Expand file treeCollapse file tree2 files changed
+25
-12
lines changed Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | module.exports = {
|
2 | 2 | webpack: {
|
3 |
| -configure:{ |
4 |
| -// See https://.com/webpack/webpack/issues/6725 |
5 |
| -module:{ |
6 |
| -rules: [{ |
7 |
| -test: /\.wasm$/, |
8 |
| -type: 'javascript/auto', |
9 |
| -}] |
10 |
| -} |
11 |
| -} |
12 |
| -} |
13 |
| -}; |
| 3 | +configure: (webpackConfig) => { |
| 4 | +// Add the following lines to handle 'crypto' and 'fs' dependencies |
| 5 | +webpackConfig.resolve.fallback = { |
| 6 | +fs: require.resolve("browserify-fs"), // or 'empty' if you prefer an empty module |
| 7 | +crypto: require.resolve('crypto-browserify'), |
| 8 | +stream: require.resolve('stream-browserify'), |
| 9 | +}; |
| 10 | + |
| 11 | +// Add the 'module' configuration for handling .wasm files |
| 12 | +webpackConfig.module.rules.push({ |
| 13 | +test: /\.wasm$/, |
| 14 | +type: 'javascript/auto', |
| 15 | +}); |
| 16 | + |
| 17 | +return webpackConfig; |
| 18 | +}, |
| 19 | +}, |
| 20 | +}; |
| 21 | + |
Original file line number | Diff line number | Diff line change |
---|
|
9 | 9 | "main": "src/index.js",
|
10 | 10 | "license": "MIT",
|
11 | 11 | "dependencies": {
|
| 12 | +"@babel/plugin-proposal-private-property-in-object": "^7.21.11", |
| 13 | +"browserify-fs": "^1.0.0", |
| 14 | +"crypto-browserify": "^3.12.0", |
12 | 15 | "react": "^17.0.2",
|
13 | 16 | "react-dom": "^17.0.2",
|
14 |
| -"sql.js": "^1.6.2" |
| 17 | +"sql.js": "^1.6.2", |
| 18 | +"stream-browserify": "^3.0.0" |
15 | 19 | },
|
16 | 20 | "devDependencies": {
|
17 | 21 | "@craco/craco": "^5.9.0",
|
| 22 | +"react-scripts": "^5.0.1", |
18 | 23 | "typescript": "^4.5.5"
|
19 | 24 | },
|
20 | 25 | "scripts": {
|
|
You can’t perform that action at this time.
0 commit comments