Skip to content

Commit e860c3b

Browse files
authored
fix(cli): add resolve.fallback for node dependencies in the export-dynamic-plugin CLI for frontend plugins. (janus-idp#1590)
* update yarn.lock * fix(cli): add `resolve.fallback` for node dependencies in the `export-dynamic-plugin` CLI for frontend plugins. Signed-off-by: David Festal <[email protected]> --------- Signed-off-by: David Festal <[email protected]>
1 parent c54f41b commit e860c3b

File tree

2 files changed

+18
-64
lines changed

2 files changed

+18
-64
lines changed

packages/cli/src/lib/bundler/scalprumConfig.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { DynamicRemotePlugin } from '@openshift/dynamic-plugin-sdk-webpack';
22
import ESLintPlugin from 'eslint-webpack-plugin';
33
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
4+
import pickBy from 'lodash/pickBy';
45
import webpack, { ProvidePlugin } from 'webpack';
56

67
import { join as joinPath, resolve as resolvePath } from 'path';
@@ -142,6 +143,23 @@ export async function createScalprumConfig(
142143
),
143144
},
144145
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.wasm'],
146+
fallback: {
147+
...pickBy(require('node-libs-browser')),
148+
module: false,
149+
dgram: false,
150+
dns: false,
151+
fs: false,
152+
http2: false,
153+
net: false,
154+
tls: false,
155+
child_process: false,
156+
157+
/* new ignores */
158+
path: false,
159+
https: false,
160+
http: false,
161+
util: require.resolve('util/'),
162+
},
145163
},
146164
module: {
147165
rules: loaders,

yarn.lock

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6461,70 +6461,6 @@
64616461
yml-loader "^2.1.0"
64626462
yn "^4.0.0"
64636463

6464-
"@janus-idp/[email protected]":
6465-
version "1.8.0"
6466-
resolved "https://registry.npmjs.org/@janus-idp/cli/-/cli-1.8.0.tgz#e08b147c926032aba5b59de155eb0df9fedfec83"
6467-
integrity sha512-gGgfKmY3j0vcE9A59se+3nY4lI/l3HlRRr+s6IQ51Az04uYJ7L7cBC0I74tA0BD0EmC+hm3dAHpziRiX0bCroA==
6468-
dependencies:
6469-
"@backstage/cli-common" "^0.1.13"
6470-
"@backstage/cli-node" "^0.2.4"
6471-
"@backstage/config" "^1.2.0"
6472-
"@backstage/config-loader" "^1.7.0"
6473-
"@backstage/errors" "^1.2.4"
6474-
"@backstage/eslint-plugin" "^0.1.6"
6475-
"@backstage/types" "^1.1.1"
6476-
"@manypkg/get-packages" "^1.1.3"
6477-
"@openshift/dynamic-plugin-sdk-webpack" "^3.0.0"
6478-
"@pmmmwh/react-refresh-webpack-plugin" "^0.5.7"
6479-
"@rollup/plugin-commonjs" "^25.0.4"
6480-
"@rollup/plugin-json" "^6.0.0"
6481-
"@rollup/plugin-node-resolve" "^15.2.1"
6482-
"@rollup/plugin-yaml" "^4.0.0"
6483-
"@svgr/rollup" "^8.1.0"
6484-
"@svgr/webpack" "^6.5.1"
6485-
"@yarnpkg/lockfile" "^1.1.0"
6486-
"@yarnpkg/parsers" "^3.0.0-rc.4"
6487-
bfj "^7.0.2"
6488-
chalk "^4.0.0"
6489-
chokidar "^3.3.1"
6490-
commander "^9.1.0"
6491-
css-loader "^6.5.1"
6492-
esbuild "^0.19.0"
6493-
esbuild-loader "^2.18.0"
6494-
eslint "^8.49.0"
6495-
eslint-config-prettier "^8.10.0"
6496-
eslint-webpack-plugin "^3.2.0"
6497-
express "^4.18.2"
6498-
fork-ts-checker-webpack-plugin "^7.0.0-alpha.8"
6499-
fs-extra "^10.1.0"
6500-
handlebars "^4.7.7"
6501-
html-webpack-plugin "^5.3.1"
6502-
inquirer "^8.2.0"
6503-
is-native-module "^1.1.3"
6504-
lodash "^4.17.21"
6505-
mini-css-extract-plugin "^2.4.2"
6506-
node-libs-browser "^2.2.1"
6507-
npm-packlist "^5.0.0"
6508-
ora "^5.3.0"
6509-
postcss "^8.2.13"
6510-
process "^0.11.10"
6511-
react-dev-utils "^12.0.0-next.60"
6512-
react-refresh "^0.14.0"
6513-
recursive-readdir "^2.2.2"
6514-
rollup "^2.78.0"
6515-
rollup-plugin-dts "^4.0.1"
6516-
rollup-plugin-esbuild "^4.7.2"
6517-
rollup-plugin-postcss "^4.0.0"
6518-
rollup-pluginutils "^2.8.2"
6519-
semver "^7.5.4"
6520-
style-loader "^3.3.1"
6521-
swc-loader "^0.2.3"
6522-
typescript-json-schema "^0.62.0"
6523-
webpack "^5.89.0"
6524-
webpack-dev-server "^4.15.1"
6525-
yml-loader "^2.1.0"
6526-
yn "^4.0.0"
6527-
65286464
"@jest/console@^29.7.0":
65296465
version "29.7.0"
65306466
resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc"

0 commit comments

Comments
 (0)