mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-04-22 10:42:10 +00:00
fix: module exports not working
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
parent
c392b27cac
commit
98c80fcd20
11
package.json
11
package.json
@ -4,6 +4,7 @@
|
|||||||
"main": "./dist/tcgdex.node.js",
|
"main": "./dist/tcgdex.node.js",
|
||||||
"module": "./dist/tcgdex.node.mjs",
|
"module": "./dist/tcgdex.node.mjs",
|
||||||
"types": "./dist/tcgdex.node.d.ts",
|
"types": "./dist/tcgdex.node.d.ts",
|
||||||
|
"browser": "./dist/tcgdex.browser.global.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"require": {
|
"require": {
|
||||||
@ -11,8 +12,8 @@
|
|||||||
"default": "./dist/tcgdex.node.js"
|
"default": "./dist/tcgdex.node.js"
|
||||||
},
|
},
|
||||||
"import": {
|
"import": {
|
||||||
"default": "./dist/tcgdex.node.mjs",
|
"types": "./dist/tcgdex.node.d.mts",
|
||||||
"types": "./dist/tcgdex.node.d.mts"
|
"default": "./dist/tcgdex.node.mjs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -30,7 +31,9 @@
|
|||||||
"api",
|
"api",
|
||||||
"typescript",
|
"typescript",
|
||||||
"javascript",
|
"javascript",
|
||||||
"typing"
|
"typing",
|
||||||
|
"browser",
|
||||||
|
"node"
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -55,7 +58,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node scripts/export-version-number.js",
|
"prebuild": "node scripts/export-version-number.js",
|
||||||
"build": "tsup ./src/tcgdex.node.ts --format cjs,esm --dts --clean && tsup ./src/tcgdex.browser.ts --format iife --minify --sourcemap",
|
"build": "tsup ./src/tcgdex.node.ts --format cjs,esm --dts --clean && tsup ./src/tcgdex.browser.ts --format iife --global-name TCGdex --sourcemap",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"test": "jest --coverage"
|
"test": "jest --coverage"
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import TCGdex from './tcgdex'
|
|
||||||
import unfetch from 'unfetch'
|
import unfetch from 'unfetch'
|
||||||
|
import TCGdex from './tcgdex'
|
||||||
|
|
||||||
TCGdex.fetch = window.fetch ?? unfetch as any
|
TCGdex.fetch = window.fetch ?? unfetch as any
|
||||||
|
|
||||||
if (typeof global !== 'undefined') {
|
export default TCGdex
|
||||||
global.TCGdex = TCGdex
|
|
||||||
}
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
(window as any).TCGdex = TCGdex
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user