diff --git a/package.json b/package.json index b2c647d..f96f2fb 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ".": { "import": "./dist/esm/index.mjs", "require": "./dist/cjs/index.cjs", - "types": "dist/index.d.ts" + "types": "./dist/index.d.ts" } }, "scripts": { @@ -18,8 +18,8 @@ "clean-modules": "rimraf node_modules/ && npm install", "lint": "eslint src/**/*.ts", "format": "eslint src/**/*.ts --fix", - "build:dev": "tsup && tsup --dts-only --outDir dist", - "build:prod": "tsup --minify && tsup --dts-only --outDir dist", + "build:dev": "tsup --metafile", + "build:prod": "tsup --minify", "publish": "npm run build:prod", "pretty": "prettier --write ." }, diff --git a/tsconfig-base.json b/tsconfig-base.json index 5e4595d..a33b061 100644 --- a/tsconfig-base.json +++ b/tsconfig-base.json @@ -12,9 +12,8 @@ "preserveSymlinks": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "types": ["@types/node"], "isolatedModules": true }, "exclude": ["node_modules", "dist"], - "include": ["src"] + "include": ["src", "**/*.d.ts"] } diff --git a/tsconfig.json b/tsconfig.json index 9bb4c50..d98f34e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,4 @@ + { "extends": "./tsconfig-esm.json" } diff --git a/tsup.config.js b/tsup.config.js index d1ba7ca..e1d7160 100644 --- a/tsup.config.js +++ b/tsup.config.js @@ -12,11 +12,12 @@ const shared = { correctVarValueBeforeDeclaration: true, //need this to treeshake esm discord.js empty import annotations: true, }, + dts: false }; export default defineConfig([ { format: 'esm', - target: 'node16', + target: 'node18', tsconfig: './tsconfig-esm.json', outDir: './dist/esm', splitting: true, @@ -37,7 +38,7 @@ export default defineConfig([ format: 'cjs', esbuildPlugins: [ifdefPlugin({ variables: { MODE: 'cjs' }, verbose: true })], splitting: false, - target: 'node16', + target: 'node18', tsconfig: './tsconfig-cjs.json', outDir: './dist/cjs', outExtension() { @@ -50,10 +51,12 @@ export default defineConfig([ await writeFile('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' })); }, ...shared, - }, -// { -// dts: true, -// entry: ['src/presets/*.ts' ] -// -// } + }, + { + dts: { + only: true + }, + entry: ['src/index.ts'], + outDir: 'dist' + } ]);