From a7ef41b88aa499d63b69ee1a8401109d6e6967c2 Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Wed, 1 Nov 2023 14:29:28 +0100 Subject: [PATCH] build(webpack): remove ApiDOM resolve aliases Instead of maintaining the fragile resolve aliases, npm overrides package.json field will be used to avoid double-bundling different versions of ApiDOM. --- .../react-scripts/config/webpack.config.js | 65 ------------------- 1 file changed, 65 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 2c299cdc..c11310d1 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -363,71 +363,6 @@ module.exports = function (webpackEnv) { // This alias makes sure we're avoiding a runtime error related to this package '@stoplight/ordered-object-literal$': '/node_modules/@stoplight/ordered-object-literal/src/index.mjs', - // This alias makes sure we don't pull two different versions of ApiDOM. - // swagger-client uses ApiDOM as well, and might come with different ApiDOM version. - // SwaggerEditor ApiDOM dependency takes precendence in the resolution. - '@swagger-api/apidom-ast$': - '/node_modules/@swagger-api/apidom-ast/es/index.mjs', - '@swagger-api/apidom-core$': - '/node_modules/@swagger-api/apidom-core/es/index.mjs', - '@swagger-api/apidom-error$': - '/node_modules/@swagger-api/apidom-error/es/index.mjs', - '@swagger-api/apidom-json-path$': - '/node_modules/@swagger-api/apidom-json-path/es/index.mjs', - '@swagger-api/apidom-json-pointer$': - '/node_modules/@swagger-api/apidom-json-pointer/es/index.mjs', - '@swagger-api/apidom-ls$': - '/node_modules/@swagger-api/apidom-ls/es/index.mjs', - '@swagger-api/apidom-ns-api-design-systems$': - '/node_modules/@swagger-api/apidom-ns-api-design-systems/es/index.mjs', - '@swagger-api/apidom-ns-asyncapi-2$': - '/node_modules/@swagger-api/apidom-ns-asyncapi-2/es/index.mjs', - '@swagger-api/apidom-ns-json-schema-draft-4$': - '/node_modules/@swagger-api/apidom-ns-json-schema-draft-4/es/index.mjs', - '@swagger-api/apidom-ns-json-schema-draft-6$': - '/node_modules/@swagger-api/apidom-ns-json-schema-draft-6/es/index.mjs', - '@swagger-api/apidom-ns-json-schema-draft-7$': - '/node_modules/@swagger-api/apidom-ns-json-schema-draft-7/es/index.mjs', - '@swagger-api/apidom-ns-openapi-3-0$': - '/node_modules/@swagger-api/apidom-ns-openapi-3-0/es/index.mjs', - '@swagger-api/apidom-ns-openapi-3-1$': - '/node_modules/@swagger-api/apidom-ns-openapi-3-1/es/index.mjs', - '@swagger-api/apidom-parser$': - '/node_modules/@swagger-api/apidom-parser/es/parser.mjs', - '@swagger-api/apidom-parser-adapter-api-design-systems-json$': - '/node_modules/@swagger-api/apidom-parser-adapter-api-design-systems-json/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-api-design-systems-yaml$': - '/node_modules/@swagger-api/apidom-parser-adapter-api-design-systems-yaml/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-asyncapi-json-2$': - '/node_modules/@swagger-api/apidom-parser-adapter-asyncapi-json-2/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-asyncapi-yaml-2$': - '/node_modules/@swagger-api/apidom-parser-adapter-asyncapi-yaml-2/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-json$': - '/node_modules/@swagger-api/apidom-parser-adapter-json/es/adapter-browser.mjs', - '@swagger-api/apidom-parser-adapter-openapi-json-3-0$': - '/node_modules/@swagger-api/apidom-parser-adapter-openapi-json-3-0/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-openapi-json-3-1$': - '/node_modules/@swagger-api/apidom-parser-adapter-openapi-json-3-1/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-openapi-yaml-3-0$': - '/node_modules/@swagger-api/apidom-parser-adapter-openapi-yaml-3-0/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-openapi-yaml-3-1$': - '/node_modules/@swagger-api/apidom-parser-adapter-openapi-yaml-3-1/es/adapter.mjs', - '@swagger-api/apidom-parser-adapter-yaml-1-2$': - '/node_modules/@swagger-api/apidom-parser-adapter-yaml-1-2/es/adapter-browser.mjs', - '@swagger-api/apidom-reference$': - '/node_modules/@swagger-api/apidom-reference/es/configuration/saturated.mjs', - '@swagger-api/apidom-reference/configuration/empty$': - '/node_modules/@swagger-api/apidom-reference/es/configuration/empty.mjs', - '@swagger-api/apidom-reference/resolve/strategies/openapi-3-1$': - '/node_modules/@swagger-api/apidom-reference/es/resolve/strategies/openapi-3-1/index.mjs', - '@swagger-api/apidom-reference/parse/parsers/binary$': - '/node_modules/@swagger-api/apidom-reference/es/parse/parsers/binary/index-browser.mjs', - '@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/$anchor$': - '/node_modules/@swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/selectors/$anchor/index.mjs', - '@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/uri$': - '/node_modules/@swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/selectors/uri/index.mjs', - '@swagger-api/apidom-reference/dereference/strategies/openapi-3-1$': - '/node_modules/@swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/index.mjs', ...(modules.webpackAliases || {}), }, plugins: [