target: 'es2022',
dropLabels: ['NODE'],
entryPoints: [
- { in: './src/main.ts', out: 'browser.min' }
+ { in: './src/index.ts', out: 'browser' }
],
inject: [
'./esbuild/inject/buffer.mjs'
target: 'node22',
dropLabels: ['BROWSER'],
entryPoints: [
- { in: './src/main.ts', out: 'nodejs.min' }
+ { in: './src/index.ts', out: 'index' }
],
external: ['node:worker_threads'],
inject: [
"url": "git+https://zoso.dev/libnemo.git"
},
"scripts": {
- "clean": "rm -rf dist types && tsc",
- "build": "npm run clean && node esbuild/dev.mjs && cp -r types dist",
- "build:prod": "npm run clean && node esbuild/prod.mjs && cp -r types dist",
+ "clean": "rm -rf dist && tsc",
+ "build": "npm run clean && node esbuild/dev.mjs",
+ "build:prod": "npm run clean && node esbuild/prod.mjs",
"prepublishOnly": "npm run test:prod",
"reinstall": "rm -rf node_modules package-lock.json && npm cache clean --force && npm i",
"test": "npm run build && npm run test:node",
"test:node": "node --test --test-force-exit --no-experimental-strip-types --env-file .env",
"test:prod": "npm run build:prod && npm run test:node"
},
- "imports": {
- "#types": "./src/types.d.ts"
- },
"dependencies": {
"@ledgerhq/hw-transport-web-ble": "^6.33.1",
"@ledgerhq/hw-transport-webhid": "^6.34.0",
"type": "module",
"exports": {
".": {
- "types": "./dist/types/main.d.ts",
- "node": "./dist/nodejs.min.js",
- "browser": "./dist/browser.min.js",
- "import": "./dist/main.js",
- "default": "./dist/global.min.js"
+ "types": "./dist/index.d.ts",
+ "browser": "./dist/browser.js",
+ "node": "./dist/index.js",
+ "import": "./dist/index.js",
+ "default": "./dist/index.js"
}
},
- "unpkg": "dist/browser.min.js"
+ "unpkg": "dist/browser.js"
}
"alwaysStrict": true,
"checkJs": true,
"declaration": true,
- "declarationDir": "./types",
+ "declarationDir": "./dist",
"emitDeclarationOnly": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"noFallthroughCasesInSwitch": true,
"rootDir": "src",
"strict": true,
- "target": "es2024",
+ "target": "es2022",
"lib": [
"DOM",
"ES2022"