diff --git a/package.json b/package.json index 4e7b9ed..6a5b3d1 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.2.3", "scripts": { "dev": "vite", + "types": "tsc", "build": "vue-tsc --noEmit && vite build", "rollup": "rollup -c" }, @@ -25,6 +26,7 @@ "eslint-plugin-standard": "^4.0.1", "eslint-plugin-vue": "^7.9.0", "gsap": "^3.5.1", + "rollup-plugin-dts": "^3.0.1", "rollup-plugin-esbuild": "^4.1.0", "stats.js": "0.17.0", "three": "^0.127", @@ -37,7 +39,7 @@ }, "main": "build/trois.js", "module": "build/trois.module.js", - "typings": "build/trois.d.ts", + "types": "build/trois.d.ts", "repository": { "type": "git", "url": "git+https://github.com/troisjs/trois.git" diff --git a/rollup.config.js b/rollup.config.js index 02f0ada..a26fc30 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,7 @@ // import vue from 'rollup-plugin-vue' import esbuild from 'rollup-plugin-esbuild' import replace from '@rollup/plugin-replace' +import dts from "rollup-plugin-dts" const input = 'src/export.ts' @@ -65,4 +66,13 @@ export default [ createConfig('es', { file: 'build/trois.module.js' }), createConfig('es', { file: 'build/trois.module.min.js' }, [], true), createConfig('cjs', { file: 'build/trois.js' }), + { + input: 'types/export.d.ts', + external, + plugins: [dts()], + output: { + format: 'es', + file: 'build/trois.d.ts', + }, + }, ] diff --git a/tsconfig.json b/tsconfig.json index a9ac9e5..5fed8a1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ "outDir": "types", }, "include": ["src/**/*.ts", "src/**/*.vue"], + "exclude": ["src/components/**/*.ts"], // "include": ["src/export.ts"], // "exclude": ["src/App.vue", "src/main.ts"], }