mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-04-22 02:42:08 +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",
|
||||
"module": "./dist/tcgdex.node.mjs",
|
||||
"types": "./dist/tcgdex.node.d.ts",
|
||||
"browser": "./dist/tcgdex.browser.global.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": {
|
||||
@ -11,8 +12,8 @@
|
||||
"default": "./dist/tcgdex.node.js"
|
||||
},
|
||||
"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",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"typing"
|
||||
"typing",
|
||||
"browser",
|
||||
"node"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@ -55,7 +58,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"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",
|
||||
"lint": "eslint",
|
||||
"test": "jest --coverage"
|
||||
|
@ -1,11 +1,6 @@
|
||||
import TCGdex from './tcgdex'
|
||||
import unfetch from 'unfetch'
|
||||
import TCGdex from './tcgdex'
|
||||
|
||||
TCGdex.fetch = window.fetch ?? unfetch as any
|
||||
|
||||
if (typeof global !== 'undefined') {
|
||||
global.TCGdex = TCGdex
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
(window as any).TCGdex = TCGdex
|
||||
}
|
||||
export default TCGdex
|
||||
|
Loading…
x
Reference in New Issue
Block a user