Skip to content

Commit af71ccd

Browse files
committed
chore: Add path-browserify for webpack browser compatibility
Configure webpack to use path-browserify as a fallback for path resolution in browser environments, ensuring proper module handling.
1 parent de40c3f commit af71ccd

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
},
1616
"license": "MIT",
1717
"dependencies": {
18+
"@eko-ai/eko": "^1.0.9",
1819
"antd": "^5.22.4",
1920
"react": "^18.2.0",
20-
"react-dom": "^18.2.0",
21-
"@eko-ai/eko": "^1.0.9"
21+
"react-dom": "^18.2.0"
2222
},
2323
"devDependencies": {
2424
"@types/chrome": "0.0.158",
2525
"@types/react": "^18.0.29",
2626
"@types/react-dom": "^18.0.11",
2727
"copy-webpack-plugin": "^9.0.1",
2828
"glob": "^7.1.6",
29+
"path-browserify": "^1.0.1",
2930
"prettier": "^2.2.1",
3031
"rimraf": "^3.0.2 ",
3132
"ts-loader": "^8.0.0",

webpack/webpack.common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ module.exports = {
3333
},
3434
resolve: {
3535
extensions: [".ts", ".tsx", ".js"],
36+
fallback: {
37+
"path": require.resolve("path-browserify"),
38+
"fs": false
39+
}
3640
},
3741
plugins: [
3842
new CopyWebpackPlugin({

0 commit comments

Comments
 (0)