Skip to content

Commit

Permalink
Add polyfills for process and buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 23, 2024
1 parent 7b68619 commit 93b09be
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@uppy/xhr-upload": "^1.6.10",
"@vueuse/components": "^10.7.2",
"bootstrap": "^4.5.3",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"cytoscape": "^3.23.0",
"cytoscape-cola": "^2.5.1",
Expand All @@ -35,6 +36,7 @@
"mermaid": "^10.1.0",
"primeicons": "^7.0.0",
"primevue": "^4.0.0",
"process": "^0.11.10",
"qrcode-vue3": "^1.6.8",
"serve": "^14.2.1",
"stream-browserify": "^3.0.0",
Expand Down
10 changes: 10 additions & 0 deletions webapp/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const { ProvidePlugin } = require("webpack");

module.exports = {
transpileDependencies: ["mermaid"],
configureWebpack: (config) => {
config.resolve.fallback = {
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
process: require.resolve("process/browser"),
buffer: require.resolve("buffer/"),
};
config.externals = {
...config.externals,
Expand All @@ -14,6 +18,12 @@ module.exports = {
include: /node_modules/,
type: "javascript/auto",
});
config.plugins = [
...(config.plugins || []),
new ProvidePlugin({
process: "process/browser",
}),
];
},
chainWebpack: (config) => {
config.plugin("html").tap((args) => {
Expand Down
10 changes: 9 additions & 1 deletion webapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3084,6 +3084,14 @@ buffer@^5.5.0, buffer@^5.7.1:
base64-js "^1.3.1"
ieee754 "^1.1.13"

buffer@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
dependencies:
base64-js "^1.3.1"
ieee754 "^1.2.1"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
Expand Down Expand Up @@ -5663,7 +5671,7 @@ icss-utils@^5.0.0, icss-utils@^5.1.0:
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==

ieee754@^1.1.13:
ieee754@^1.1.13, ieee754@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
Expand Down

0 comments on commit 93b09be

Please sign in to comment.