Skip to content

Commit

Permalink
fix(cli): add resolve.fallback for node dependencies in the `export…
Browse files Browse the repository at this point in the history
…-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 <dfestal@redhat.com>

---------

Signed-off-by: David Festal <dfestal@redhat.com>
  • Loading branch information
davidfestal authored Apr 30, 2024
1 parent c54f41b commit e860c3b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 64 deletions.
18 changes: 18 additions & 0 deletions packages/cli/src/lib/bundler/scalprumConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DynamicRemotePlugin } from '@openshift/dynamic-plugin-sdk-webpack';
import ESLintPlugin from 'eslint-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import pickBy from 'lodash/pickBy';
import webpack, { ProvidePlugin } from 'webpack';

import { join as joinPath, resolve as resolvePath } from 'path';
Expand Down Expand Up @@ -142,6 +143,23 @@ export async function createScalprumConfig(
),
},
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.wasm'],
fallback: {
...pickBy(require('node-libs-browser')),
module: false,
dgram: false,
dns: false,
fs: false,
http2: false,
net: false,
tls: false,
child_process: false,

/* new ignores */
path: false,
https: false,
http: false,
util: require.resolve('util/'),
},
},
module: {
rules: loaders,
Expand Down
64 changes: 0 additions & 64 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6461,70 +6461,6 @@
yml-loader "^2.1.0"
yn "^4.0.0"

"@janus-idp/cli@1.8.0":
version "1.8.0"
resolved "https://registry.npmjs.org/@janus-idp/cli/-/cli-1.8.0.tgz#e08b147c926032aba5b59de155eb0df9fedfec83"
integrity sha512-gGgfKmY3j0vcE9A59se+3nY4lI/l3HlRRr+s6IQ51Az04uYJ7L7cBC0I74tA0BD0EmC+hm3dAHpziRiX0bCroA==
dependencies:
"@backstage/cli-common" "^0.1.13"
"@backstage/cli-node" "^0.2.4"
"@backstage/config" "^1.2.0"
"@backstage/config-loader" "^1.7.0"
"@backstage/errors" "^1.2.4"
"@backstage/eslint-plugin" "^0.1.6"
"@backstage/types" "^1.1.1"
"@manypkg/get-packages" "^1.1.3"
"@openshift/dynamic-plugin-sdk-webpack" "^3.0.0"
"@pmmmwh/react-refresh-webpack-plugin" "^0.5.7"
"@rollup/plugin-commonjs" "^25.0.4"
"@rollup/plugin-json" "^6.0.0"
"@rollup/plugin-node-resolve" "^15.2.1"
"@rollup/plugin-yaml" "^4.0.0"
"@svgr/rollup" "^8.1.0"
"@svgr/webpack" "^6.5.1"
"@yarnpkg/lockfile" "^1.1.0"
"@yarnpkg/parsers" "^3.0.0-rc.4"
bfj "^7.0.2"
chalk "^4.0.0"
chokidar "^3.3.1"
commander "^9.1.0"
css-loader "^6.5.1"
esbuild "^0.19.0"
esbuild-loader "^2.18.0"
eslint "^8.49.0"
eslint-config-prettier "^8.10.0"
eslint-webpack-plugin "^3.2.0"
express "^4.18.2"
fork-ts-checker-webpack-plugin "^7.0.0-alpha.8"
fs-extra "^10.1.0"
handlebars "^4.7.7"
html-webpack-plugin "^5.3.1"
inquirer "^8.2.0"
is-native-module "^1.1.3"
lodash "^4.17.21"
mini-css-extract-plugin "^2.4.2"
node-libs-browser "^2.2.1"
npm-packlist "^5.0.0"
ora "^5.3.0"
postcss "^8.2.13"
process "^0.11.10"
react-dev-utils "^12.0.0-next.60"
react-refresh "^0.14.0"
recursive-readdir "^2.2.2"
rollup "^2.78.0"
rollup-plugin-dts "^4.0.1"
rollup-plugin-esbuild "^4.7.2"
rollup-plugin-postcss "^4.0.0"
rollup-pluginutils "^2.8.2"
semver "^7.5.4"
style-loader "^3.3.1"
swc-loader "^0.2.3"
typescript-json-schema "^0.62.0"
webpack "^5.89.0"
webpack-dev-server "^4.15.1"
yml-loader "^2.1.0"
yn "^4.0.0"

"@jest/console@^29.7.0":
version "29.7.0"
resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc"
Expand Down

0 comments on commit e860c3b

Please sign in to comment.