Hi, in my dist/.d.ts has the following content: export from "../src/index", but when we publish npm, we only push dist folder. how are we going to get the types? I don't see *.es.js has the types neither? is there anything I am doing wrong?
my vite config:
import { defineConfig } from 'vite';
import dts from 'vite-dts';
// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: 'src/index.ts',
formats: ['es'],
},
rollupOptions: {
external: ['react'],
output: {
// Since we publish our ./src folder, there's no point
// in bloating sourcemaps with another copy of it.
sourcemapExcludeSources: true,
},
},
sourcemap: true,
// Reduce bloat from legacy polyfills.
target: 'esnext',
// Leave minification up to applications.
minify: false,
},
plugins: [dts()],
});
my index.ts
export { TestButton } from './components/TestButton';
export type { TestButtonProps } from './components/TestButton';
Hi, in my dist/.d.ts has the following content: export from "../src/index", but when we publish npm, we only push dist folder. how are we going to get the types? I don't see *.es.js has the types neither? is there anything I am doing wrong?
my vite config:
my index.ts