From 7cf480fda6581731b65de1c59d2f994f786c3e32 Mon Sep 17 00:00:00 2001 From: Egge Date: Thu, 19 Dec 2024 19:45:48 +0100 Subject: [PATCH] config cleanup --- package.json | 3 ++- tsconfig.es5.json | 13 ------------- tsconfig.json | 7 +++---- vite.config.ts | 5 +---- 4 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 tsconfig.es5.json diff --git a/package.json b/package.json index 7c9a26394..b9f830e66 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@cashu/cashu-ts", "version": "2.1.0", "description": "cashu library for communicating with a cashu mint", + "type": "module", "main": "lib/cashu-ts.cjs.js", "module": "lib/cashu-ts.es.js", "types": "lib/types/index.d.ts", @@ -13,7 +14,7 @@ "url": "https://github.com/cashubtc/cashu-ts/issues" }, "scripts": { - "compile": "rm -rf lib && vite build && BUILD_FORMAT=iife vite build", + "compile": "vite build && BUILD_FORMAT=iife vite build", "test": "vitest run --coverage --exclude ./test/integration.test.ts", "test-integration": "vitest run ./test/integration.test.ts --coverage", "dev": "tsc --watch", diff --git a/tsconfig.es5.json b/tsconfig.es5.json deleted file mode 100644 index ec351e2f9..000000000 --- a/tsconfig.es5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "ES5", - "declaration": true, - "outDir": "./dist/lib/es5", - "moduleResolution": "node", - "lib": ["ES2020", "DOM"], - "noImplicitAny": true, - "esModuleInterop": true - }, - "include": ["src/**/*"] -} diff --git a/tsconfig.json b/tsconfig.json index e45469244..343b279f3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,14 @@ { "compilerOptions": { - "module": "ES2020", + "module": "ESNext", "target": "ES2020", "lib": ["ES2020", "DOM"], "declaration": true, "emitDeclarationOnly": true, "outDir": "lib/types", - "moduleResolution": "nodenext", + "moduleResolution": "bundler", "strict": true, - "sourceMap": true, - "esModuleInterop": true + "sourceMap": true }, "include": ["src/**/*"] } diff --git a/vite.config.ts b/vite.config.ts index aa4608046..1f7347e00 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,6 @@ import { resolve } from 'path'; import { defineConfig } from 'vite'; -import pkg from './package.json'; import dts from 'vite-plugin-dts'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; const config = process.env.BUILD_FORMAT === 'iife' @@ -24,7 +21,7 @@ const config = }) : defineConfig({ build: { - emptyOutDir: false, + emptyOutDir: true, outDir: 'lib', target: 'es2020', lib: {