Skip to content

Commit a101d0b

Browse files
committed
chore: modify xlsx library loading method to use a local file instead of CDN
1 parent 0b3fc57 commit a101d0b

3 files changed

Lines changed: 35058 additions & 4 deletions

File tree

‎lib/x2t.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class X2TConverter {
312312
}
313313

314314
/**
315-
* Load xlsx library dynamically from CDN
315+
* Load xlsx library from local file
316316
*/
317317
private async loadXlsxLibrary(): Promise<any> {
318318
// Check if xlsx is already loaded
@@ -322,7 +322,7 @@ class X2TConverter {
322322

323323
return new Promise((resolve, reject) => {
324324
const script = document.createElement('script');
325-
script.src = 'https://cdn.sheetjs.com/xlsx-0.20.1/package/dist/xlsx.full.min.js';
325+
script.src = `${BASE_PATH}libs/sheetjs/xlsx.full.min.js`;
326326
script.onload = () => {
327327
if (typeof window !== 'undefined' && (window as any).XLSX) {
328328
resolve((window as any).XLSX);
@@ -331,7 +331,7 @@ class X2TConverter {
331331
}
332332
};
333333
script.onerror = () => {
334-
reject(new Error('Failed to load xlsx library from CDN'));
334+
reject(new Error('Failed to load xlsx library from local file'));
335335
};
336336
document.head.appendChild(script);
337337
});

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"keywords": [],
1919
"author": "",
20-
"license": "MIT",
20+
"license": "AGPL-3.0",
2121
"devDependencies": {
2222
"@eslint/js": "^9.39.1",
2323
"@tailwindcss/postcss": "^4.1.17",

0 commit comments

Comments
 (0)