From cbb1424b7d59b9d453f34031b513477969cbb6e1 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Tue, 28 Feb 2023 12:35:37 +0530 Subject: [PATCH] fix: change import to default in package exports (#1028) --- .changeset/two-carrots-provide.md | 7 +++++++ packages/blade/package.json | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .changeset/two-carrots-provide.md diff --git a/.changeset/two-carrots-provide.md b/.changeset/two-carrots-provide.md new file mode 100644 index 00000000000..fbf60b0835e --- /dev/null +++ b/.changeset/two-carrots-provide.md @@ -0,0 +1,7 @@ +--- +'@razorpay/blade': patch +--- + +fix: change import to default in package exports + +Jest does not support the "import" condition in exports. This was causing tests to fail for Blade consumers. Changed "import" to "default" which is supported by all tools. Since Blade is not exporting a dual package, we don't need the "import" condition. diff --git a/packages/blade/package.json b/packages/blade/package.json index e707f1584ff..c52efcf54c5 100644 --- a/packages/blade/package.json +++ b/packages/blade/package.json @@ -29,32 +29,32 @@ "exports": { "./components": { "react-native": { - "import": "./build/components/index.native.js", - "types": "./build/components/index.native.d.ts" + "types": "./build/components/index.native.d.ts", + "default": "./build/components/index.native.js" }, "default": { - "import": "./build/components/index.web.js", - "types": "./build/components/index.d.ts" + "types": "./build/components/index.d.ts", + "default": "./build/components/index.web.js" } }, "./tokens": { "react-native": { - "import": "./build/tokens/index.native.js", - "types": "./build/tokens/index.native.d.ts" + "types": "./build/tokens/index.native.d.ts", + "default": "./build/tokens/index.native.js" }, "default": { - "import": "./build/tokens/index.web.js", - "types": "./build/tokens/index.d.ts" + "types": "./build/tokens/index.d.ts", + "default": "./build/tokens/index.web.js" } }, "./utils": { "react-native": { - "import": "./build/utils/index.native.js", - "types": "./build/utils/index.native.d.ts" + "types": "./build/utils/index.native.d.ts", + "default": "./build/utils/index.native.js" }, "default": { - "import": "./build/utils/index.web.js", - "types": "./build/utils/index.d.ts" + "types": "./build/utils/index.d.ts", + "default": "./build/utils/index.web.js" } } },