From 818dd9224372705e809f84eede5d447e6b3ee875 Mon Sep 17 00:00:00 2001 From: MrWook Date: Fri, 4 Oct 2024 09:57:03 +0200 Subject: [PATCH] feat(project): remove index file BREAKING CHANGE: we don't need this index file --- package.json | 26 +++++++++++++++++--------- src/index.ts | 4 ---- tsup.config.js => tsup.config.ts | 7 +++++-- 3 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 src/index.ts rename tsup.config.js => tsup.config.ts (73%) diff --git a/package.json b/package.json index 3e02944..9ecb562 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,29 @@ { "name": "@zxcvbn-ts/dictionary-compression", "version": "4.0.0-beta.2", - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", "type": "commonjs", "exports": { - ".": { + "./compress": { "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" + "types": "./dist/compress.d.mts", + "default": "./dist/compress.mjs" }, "require": { - "types": "./dist/index.d.ts", - "default": "./dist/index.cjs" + "types": "./dist/compress.d.ts", + "default": "./dist/compress.cjs" }, - "default": "./dist/index.cjs" + "default": "./dist/compress.cjs" + }, + "./decompress": { + "import": { + "types": "./dist/decompress.d.mts", + "default": "./dist/decompress.mjs" + }, + "require": { + "types": "./dist/decompress.d.ts", + "default": "./dist/decompress.cjs" + }, + "default": "./dist/decompress.cjs" } }, "scripts": { diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index b1bb164..0000000 --- a/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import compress from './compress' -import decompress from './decompress' - -export { compress, decompress } diff --git a/tsup.config.js b/tsup.config.ts similarity index 73% rename from tsup.config.js rename to tsup.config.ts index 5ccbc70..e49f955 100644 --- a/tsup.config.js +++ b/tsup.config.ts @@ -1,13 +1,16 @@ -export default { +import { defineConfig } from 'tsup' + +export default defineConfig({ entry: ['src/**/*.ts'], format: ["esm", "cjs"], dts: true, bundle: false, sourcemap: true, + clean: true, outExtension({ format }) { const extension = format === 'esm' ? '.mjs' : '.cjs' return { js: `${extension}`, } }, -}; \ No newline at end of file +})