forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(examples): front-end packages missing browserify polyfills hyperl…
…edger-cacti#1224 The webpack build done by the Angular CLI (ng) was broken due to a few different issues combined together: 1. After upgrading to Angular v12 IE 11 is no longer supported which necessitated the explicit configuration in the browserlist rc config file accordingly so that the compilation process does not try to support a browser for which the build is broken to begin with. 2. polyfills had to be added via customizing the webpack configuration used by the Angular CLI internally which is now being done by using a custom builder as specified in the angular.json file. This is the new method of dealing with these kind of issues after the ng eject command was deprecated a while back. The webpack.config.overrides.js files that are beind added in this commit contain only the overrides (as the name suggests) not the entire webpack configuration that the Angular CLI uses internally to build the front end packages. Fixes hyperledger-cacti#1224 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
- Loading branch information
Showing
11 changed files
with
888 additions
and
29 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
examples/cactus-example-carbon-accounting-frontend/.browserslistrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
last 1 Chrome version | ||
last 1 Firefox version | ||
last 2 Edge major versions | ||
last 2 Safari major versions | ||
last 2 iOS major versions | ||
Firefox ESR | ||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
examples/cactus-example-carbon-accounting-frontend/webpack.config.overrides.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** @type {import("webpack").Configuration} */ | ||
module.exports = { | ||
externals: { | ||
express: "express", | ||
"prom-client": "prom-client", | ||
}, | ||
resolve: { | ||
fallback: { | ||
crypto: require.resolve("crypto-browserify"), | ||
buffer: require.resolve("buffer/"), | ||
http: require.resolve("stream-http"), | ||
https: require.resolve("https-browserify"), | ||
os: require.resolve("os-browserify/browser"), | ||
path: require.resolve("path-browserify"), | ||
stream: require.resolve("stream-browserify"), | ||
zlib: require.resolve("browserify-zlib"), | ||
}, | ||
}, | ||
}; |
7 changes: 7 additions & 0 deletions
7
examples/cactus-example-supply-chain-frontend/.browserslistrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
last 1 Chrome version | ||
last 1 Firefox version | ||
last 2 Edge major versions | ||
last 2 Safari major versions | ||
last 2 iOS major versions | ||
Firefox ESR | ||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
examples/cactus-example-supply-chain-frontend/webpack.config.overrides.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** @type {import("webpack").Configuration} */ | ||
module.exports = { | ||
externals: { | ||
"@fidm/x509": "@fidm/x509", | ||
"@grpc/grpc-js": "@grpc/grpc-js", | ||
"@grpc/proto-loader": "@grpc/proto-loader", | ||
busboy: "busboy", | ||
child_process: "child_process", | ||
"cross-spawn": "cross-spawn", | ||
decompress: "decompress", | ||
express: "express", | ||
"fabric-ca-client": "fabric-ca-client", | ||
"fabric-common": "fabric-common", | ||
"fabric-network": "fabric-network", | ||
"fd-slicer": "fd-slicer", | ||
fs: "fs", | ||
"node-ssh": "node-ssh", | ||
"prom-client": "prom-client", | ||
yargs: "yargs", | ||
winston: "winston", | ||
}, | ||
resolve: { | ||
fallback: { | ||
constants: require.resolve("constants-browserify"), | ||
crypto: require.resolve("crypto-browserify"), | ||
buffer: require.resolve("buffer/"), | ||
http: require.resolve("stream-http"), | ||
https: require.resolve("https-browserify"), | ||
os: require.resolve("os-browserify/browser"), | ||
path: require.resolve("path-browserify"), | ||
stream: require.resolve("stream-browserify"), | ||
zlib: require.resolve("browserify-zlib"), | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.