From d6851ec125b4838fc7f535c219356ddfb069031b Mon Sep 17 00:00:00 2001 From: Shaurya Gupta Date: Sat, 23 Nov 2024 17:11:26 +0530 Subject: [PATCH] Upgraded SheetJS --- package.json | 6 +++--- src/components/Common/ExcelViewer.tsx | 1 + vite.config.mts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 020d73f5e65..8042a7a049b 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "lint": "eslint ./src", "lint-fix": "eslint ./src --fix", "format": "prettier ./src ./cypress --write", - "sort-locales": "node ./scripts/sort-locales.js" + "sort-locales": "node ./scripts/sort-locales.js", + "vite": "vite --cdn https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs" }, "dependencies": { "@fontsource/figtree": "^5.1.1", @@ -95,8 +96,7 @@ "react-webcam": "^7.2.0", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", - "use-keyboard-shortcut": "^1.1.6", - "xlsx": "^0.18.5" + "use-keyboard-shortcut": "^1.1.6" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", diff --git a/src/components/Common/ExcelViewer.tsx b/src/components/Common/ExcelViewer.tsx index d35c98a6cc8..d5e922b4f5a 100644 --- a/src/components/Common/ExcelViewer.tsx +++ b/src/components/Common/ExcelViewer.tsx @@ -1,4 +1,5 @@ import { ReactNode, useEffect, useState } from "react"; +import * as XLSX from "https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs"; import CareIcon from "@/CAREUI/icons/CareIcon"; diff --git a/vite.config.mts b/vite.config.mts index 3fc64d66829..c40c35d8b19 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -93,6 +93,7 @@ export default defineConfig(({ mode }) => { "https://egov-s3-facility-10bedicu.s3.amazonaws.com", "https://egov-s3-patient-data-10bedicu.s3.amazonaws.com", "http://localhost:4566", + "https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs", ].join(" "); return {