From ca580663a5e2381dfb09994ad9192872364a5d04 Mon Sep 17 00:00:00 2001 From: userquin Date: Fri, 20 Dec 2024 18:52:39 +0100 Subject: [PATCH] chore: add link to node16 ts --- components.d.ts | 2 +- composables.d.ts | 2 +- package.json | 21 ++++++++++++--------- types.d.ts | 2 +- utils.d.ts | 2 +- vite.config.ts | 9 +++++++-- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/components.d.ts b/components.d.ts index eaae2efbe..927d75cc4 100644 --- a/components.d.ts +++ b/components.d.ts @@ -1 +1 @@ -export * from './dist/src/components/index.js' +export * from './dist/components.js' diff --git a/composables.d.ts b/composables.d.ts index 365506fb3..e662c9946 100644 --- a/composables.d.ts +++ b/composables.d.ts @@ -1 +1 @@ -export * from './dist/src/composables/index.js' +export * from './dist/composables.js' diff --git a/package.json b/package.json index fed187e84..2e23839cd 100644 --- a/package.json +++ b/package.json @@ -20,27 +20,30 @@ "sideEffects": false, "exports": { ".": { - "types": "./dist/index.d.ts", + "types": "./dist/tres.d.ts", "import": "./dist/tres.js", - "require": "./dist/tres.umd.cjs" + "require": "./dist/tres.cjs" }, "./components": { - "types": "./dist/src/components/index.d.ts" + "types": "./dist/components.d.ts", + "default": "./dist/components.js" }, "./composables": { - "types": "./dist/src/composables/index.d.ts" + "types": "./dist/composables.d.ts", + "default": "./dist/composables.js" }, "./types": { - "types": "./dist/src/types/index.d.ts" + "types": "./dist/types.d.ts" }, "./utils": { - "types": "./dist/src/utils/index.d.ts" + "types": "./dist/utils.d.ts", + "default": "./dist/utils.js" }, "./*": "./*" }, - "main": "./dist/tres.js", + "main": "./dist/tres.cjs", "module": "./dist/tres.js", - "types": "./dist/index.d.ts", + "types": "./dist/tres.d.ts", "files": [ "*.d.ts", "dist" @@ -61,7 +64,7 @@ "docs:serve": "vitepress serve docs", "docs:preview": "vitepress preview docs", "docs:contributors": "esno scripts/update-contributors.ts", - "test:attw": "attw --pack --ignore-rules cjs-resolves-to-esm" + "test:attw": "attw --pack --ignore-rules false-esm --ignore-rules cjs-resolves-to-esm" }, "peerDependencies": { "three": ">=0.133", diff --git a/types.d.ts b/types.d.ts index 9551693c9..26a125423 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1 +1 @@ -export * from './dist/src/types/index.js' +export * from './dist/types.js' diff --git a/utils.d.ts b/utils.d.ts index 3143f3664..e3f344e48 100644 --- a/utils.d.ts +++ b/utils.d.ts @@ -1 +1 @@ -export * from './dist/src/utils/index.js' +export * from './dist/utils.js' diff --git a/vite.config.ts b/vite.config.ts index 263b3a275..70133979e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -48,9 +48,14 @@ export default defineConfig({ }, build: { lib: { - entry: resolve(__dirname, 'src/index.ts'), + entry: { + tres: resolve(__dirname, 'src/index.ts'), + components: resolve(__dirname, 'src/components/index.ts'), + composables: resolve(__dirname, 'src/composables/index.ts'), + types: resolve(__dirname, 'src/types/index.ts'), + utils: resolve(__dirname, 'src/utils/index.ts'), + }, name: 'tres', - fileName: 'tres', }, watch: { include: [resolve(__dirname, 'src')],