Skip to content

Commit

Permalink
Add vite-plugin-dts for proper type building
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer committed Sep 5, 2023
1 parent 422688d commit 95a4e14
Show file tree
Hide file tree
Showing 3 changed files with 310 additions and 10 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
"dist"
],
"exports": {
".": "./dist/gosling.es.js",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/gosling.es.js",
"default": "./dist/gosling.es.js"
},
"./embed": "./dist/embed/index.js"
},
"scripts": {
Expand Down Expand Up @@ -85,7 +89,8 @@
"react-grid-layout": "^1.2.5",
"stream-browserify": "^3.0.0",
"threads": "^1.6.4",
"uuid": "^8.3.2"
"uuid": "^8.3.2",
"vite-plugin-dts": "^3.5.3"
},
"devDependencies": {
"@testing-library/react": "^10.4.8",
Expand Down
3 changes: 2 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';
import dts from 'vite-plugin-dts';
import * as esbuild from 'esbuild';
import path from 'path';
import pkg from './package.json';
Expand Down Expand Up @@ -87,7 +88,7 @@ const esm = defineConfig({
rollupOptions: { external }
},
resolve: { alias },
plugins: [manualInlineWorker]
plugins: [manualInlineWorker, dts({ rollupTypes: true })]
});

const dev = defineConfig({
Expand Down
Loading

0 comments on commit 95a4e14

Please sign in to comment.