Skip to content

Commit

Permalink
cli: reintroduce node polyfills that were removed in webpack 5 migration
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Oldsberg <[email protected]>
  • Loading branch information
Rugvip committed Aug 18, 2021
1 parent 6d7126c commit 1ac2961
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-jars-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---

Reintroduce Node.js shims that were removed in the Webpack 5 migration.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"json-schema": "^0.3.0",
"lodash": "^4.17.19",
"mini-css-extract-plugin": "^1.4.1",
"node-libs-browser": "^2.2.1",
"ora": "^5.3.0",
"postcss": "^8.1.0",
"process": "^0.11.10",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/lib/bundler/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { BundlingOptions, BackendBundlingOptions, LernaPackage } from './types';
import { version } from '../../lib/version';
import { paths as cliPaths } from '../../lib/paths';
import { runPlain } from '../run';
import pickBy from 'lodash/pickBy';

export function resolveBaseUrl(config: Config): URL {
const baseUrl = config.getString('app.baseUrl');
Expand Down Expand Up @@ -177,6 +178,7 @@ export async function createConfig(
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
mainFields: ['browser', 'module', 'main'],
fallback: {
...pickBy(require('node-libs-browser')),
module: false,
dgram: false,
dns: false,
Expand Down

0 comments on commit 1ac2961

Please sign in to comment.