From fc500afc7255c6d9d3125308221a1a454ac27081 Mon Sep 17 00:00:00 2001 From: the letter L <134443988+turbocrime@users.noreply.github.com> Date: Thu, 2 May 2024 17:52:57 -0700 Subject: [PATCH] correctly build transport-dom (#1024) --- .changeset/five-baboons-itch.md | 5 +++++ packages/transport-dom/package.json | 15 ++++++++++----- packages/transport-dom/tsconfig.json | 2 +- packages/transport-dom/vite.config.ts | 5 ++++- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .changeset/five-baboons-itch.md diff --git a/.changeset/five-baboons-itch.md b/.changeset/five-baboons-itch.md new file mode 100644 index 0000000000..54a0ba574c --- /dev/null +++ b/.changeset/five-baboons-itch.md @@ -0,0 +1,5 @@ +--- +'@penumbra-zone/transport-dom': major +--- + +correctly build transport-dom diff --git a/packages/transport-dom/package.json b/packages/transport-dom/package.json index fd835354b5..4b6f37a805 100644 --- a/packages/transport-dom/package.json +++ b/packages/transport-dom/package.json @@ -5,19 +5,24 @@ "type": "module", "scripts": { "build": "tsc && vite build", - "clean": "rm -rfv dist", + "clean": "rm -rfv dist package penumbra-zone-transport-dom-*.tgz", "lint": "eslint \"**/*.ts*\"", + "prebuild": "$npm_execpath run clean", + "prepack": "$npm_execpath run build", "test": "vitest run" }, + "files": [ + "dist" + ], "exports": { "./*": "./src/*.ts" }, "publishConfig": { - "files": [ - "dist" - ], "exports": { - "./src/*": "./dist/*.js" + "./*": { + "import": "./dist/*.js", + "types": "./dist/*.d.ts" + } } }, "devDependencies": { diff --git a/packages/transport-dom/tsconfig.json b/packages/transport-dom/tsconfig.json index 459b3e4971..91f66ac42a 100644 --- a/packages/transport-dom/tsconfig.json +++ b/packages/transport-dom/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "tsconfig/base.json", - "exclude": ["node_modules"], + "exclude": ["node_modules", "dist"], "compilerOptions": { "outDir": "dist", "noEmit": true diff --git a/packages/transport-dom/vite.config.ts b/packages/transport-dom/vite.config.ts index 3b9552b92e..191b5db109 100644 --- a/packages/transport-dom/vite.config.ts +++ b/packages/transport-dom/vite.config.ts @@ -1,5 +1,8 @@ +/// + import { defineConfig } from 'vite'; import dts from 'vite-plugin-dts'; +import { externalizeDeps } from 'vite-plugin-externalize-deps'; export default defineConfig({ build: { @@ -16,7 +19,7 @@ export default defineConfig({ formats: ['es'], }, }, - plugins: [dts({ rollupTypes: true })], + plugins: [dts({ rollupTypes: true }), externalizeDeps({ except: ['@penumbra-zone/polyfills'] })], test: { include: ['**/*.test.ts'], browser: {