From f2ad98526a4cb039109dc92f6eb0d365a5b2dfa2 Mon Sep 17 00:00:00 2001 From: Mikkel ALMONTE--RINGAUD Date: Sun, 11 Aug 2024 05:16:10 +0200 Subject: [PATCH] chore(pkg): bump and use treeshakable utilities --- package.json | 15 ++++++++++----- pnpm-lock.yaml | 10 +++++----- tsup.config.ts | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 tsup.config.ts diff --git a/package.json b/package.json index 6e35098..4c1bb39 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,17 @@ "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "exports": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "default": "./dist/index.js" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } }, "scripts": { - "build": "tsup src/index.ts --dts --minify terser --clean --format cjs,esm --sourcemap", + "build": "tsup", "release": "release-it", "lint": "tsc && eslint ." }, @@ -64,6 +69,6 @@ "typescript": "^5.5.4" }, "dependencies": { - "@literate.ink/utilities": "1.0.0-10281844077.1" + "@literate.ink/utilities": "1.0.0-10336585950.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 88d01dc..11c25e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@literate.ink/utilities': - specifier: 1.0.0-10281844077.1 - version: 1.0.0-10281844077.1 + specifier: 1.0.0-10336585950.1 + version: 1.0.0-10336585950.1 devDependencies: '@stylistic/eslint-plugin': specifier: ^2.6.2 @@ -396,8 +396,8 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@literate.ink/utilities@1.0.0-10281844077.1': - resolution: {integrity: sha512-E7az31xzM4vDTgKuzH1pYDQ4llNZZuz79HqItk7Yl6aHmxRqWVqijpgausciC/sJ0VyrxeqTVeCdyMWTPDjJGA==} + '@literate.ink/utilities@1.0.0-10336585950.1': + resolution: {integrity: sha512-reMNG1TeqhTuNxBujVRPbuRRftaA+wNOpU+a90M9fs6/UYN6taJNg85c/Lo1D2LMEJy/c+y4KWs3iw3MqGOP+A==} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -2423,7 +2423,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@literate.ink/utilities@1.0.0-10281844077.1': + '@literate.ink/utilities@1.0.0-10336585950.1': dependencies: set-cookie-parser: 2.7.0 diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..91e11fa --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + + outDir: "dist", + format: ["cjs", "esm"], + + treeshake: true, + splitting: false, + + sourcemap: true, + minify: "terser", + clean: true, + dts: true +});