cli: reintroduce node polyfills that were removed in webpack 5 migration

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-08-18 15:05:01 +02:00
parent 6d7126c2a1
commit 1ac2961c30
3 changed files with 8 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Reintroduce Node.js shims that were removed in the Webpack 5 migration.
+1
View File
@@ -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",
+2
View File
@@ -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');
@@ -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,