diff --git a/packages/cli/package.json b/packages/cli/package.json index 2aba00b0e3..3c9f85ac30 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -47,7 +47,7 @@ "@svgr/webpack": "4.3.x", "@types/start-server-webpack-plugin": "^2.2.0", "@types/webpack-env": "^1.15.2", - "@types/webpack-node-externals": "^1.7.1", + "@types/webpack-node-externals": "^2.5.0", "bfj": "^7.0.2", "chalk": "^4.0.0", "chokidar": "^3.3.1", diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 56150ad968..8049ce436d 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -152,11 +152,11 @@ export function createBackendConfig( externals: [ nodeExternals({ modulesDir: paths.rootNodeModules, - whitelist: ['webpack/hot/poll?100', /\@backstage\/.*/], + allowlist: ['webpack/hot/poll?100', /\@backstage\/.*/], }), nodeExternals({ modulesDir: paths.targetNodeModules, - whitelist: ['webpack/hot/poll?100', /\@backstage\/.*/], + allowlist: ['webpack/hot/poll?100', /\@backstage\/.*/], }), ], target: 'node' as const, diff --git a/packages/storybook/.storybook/webpack-plugin-fail-build-on-warning.js b/packages/storybook/.storybook/webpack-plugin-fail-build-on-warning.js index 1ccf825839..b812b6bac9 100644 --- a/packages/storybook/.storybook/webpack-plugin-fail-build-on-warning.js +++ b/packages/storybook/.storybook/webpack-plugin-fail-build-on-warning.js @@ -19,7 +19,7 @@ * https://github.com/spotify/backstage/issues/718. To make sure new warnings are not introduced with new PRs, we * want to fail CI builds if there are warnings when building storybook. * - * This webpack plugin makes sure the CI builds fail on Webpack warnings. We also have a whitelist of warnings here + * This webpack plugin makes sure the CI builds fail on Webpack warnings. We also have an allowlist of warnings here * which we think are non-critical. * * Note that this implementation will not detect other warnings emitted by storybook build that are separate from @@ -32,7 +32,7 @@ */ class WebpackPluginFailBuildOnWarning { // Ignore the following warnings in the Webpack build. - warningsWhitelist = new Set([ + warningsAllowlist = new Set([ 'AssetsOverSizeLimitWarning', 'EntrypointsOverSizeLimitWarning', 'NoAsyncChunksWarning', @@ -50,7 +50,7 @@ class WebpackPluginFailBuildOnWarning { if (warnings.length > 0) { // Throw error if there are unexpected warnings. for (let warning of warnings) { - if (!this.warningsWhitelist.has(warning.name)) { + if (!this.warningsAllowlist.has(warning.name)) { process.on('beforeExit', () => { console.log( `You have some unexpected warning(s) in your webpack build. Exiting process as error.`, diff --git a/yarn.lock b/yarn.lock index 62335b1479..9341567067 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5202,10 +5202,10 @@ resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.2.tgz#927997342bb9f4a5185a86e6579a0a18afc33b0a" integrity sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ== -"@types/webpack-node-externals@^1.7.1": - version "1.7.1" - resolved "https://registry.npmjs.org/@types/webpack-node-externals/-/webpack-node-externals-1.7.1.tgz#73d0d7ae0e98cfbd69b7443388302cd69217494a" - integrity sha512-kbO2gYPKvMb5j1KOgnIuUH52CKul9Ud4b10J5n+JX8oHmgu86hYpBVfrV4bMDe5lhCaO64h8QrKz7WnRZzqkbA== +"@types/webpack-node-externals@^2.5.0": + version "2.5.0" + resolved "https://registry.npmjs.org/@types/webpack-node-externals/-/webpack-node-externals-2.5.0.tgz#bcd161af84a4960416e5850e06931b35321c6654" + integrity sha512-KaWfhUQlpWknM/CMBKhV7i0vxX/N2xEy3WeaE500s4ZNxC4nLnKB+0F3gD3Fg+5octPq0nn8ZlfFR/P3dSkXpw== dependencies: "@types/webpack" "*"