diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..94c1d1d --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["src/vite-env.d.ts"] + }, + "include": [ + "src" + ], + "exclude": [ + "**/*.stories.tsx" + ], + "references": [ + { + "path": "./tsconfig.json" + } + ] + } + \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index dee6b3f..6bea824 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,20 +1,28 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import scopeTailwind from "vite-plugin-scope-tailwind"; -import { resolve } from 'path' -// import reactTailwindClassnamePrefixer from "./lib/vite-plugin-react-classname-prefixer"; +// import { resolve } from 'path' import svgr from "vite-plugin-svgr"; +import dts from 'vite-plugin-dts' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svgr(), react(), scopeTailwind({react: true})], + plugins: [svgr(), react(), scopeTailwind({react: true}), dts({ + tsconfigPath: "tsconfig.build.json" + })], resolve: { - // I have no clue why aliases are not working at all... - alias: { - '@styles/': resolve(__dirname, './styles'), - '@components/': resolve(__dirname, './src/components'), - '@assets/': resolve(__dirname, './src/assets'), - '@': resolve(__dirname, './src'), - }, + // TODO: For some reason aliases are not working.... + // alias: { + // '@styles/': resolve(__dirname, './styles'), + // '@components/': resolve(__dirname, './src/components'), + // '@assets/': resolve(__dirname, './src/assets'), + // '@': resolve(__dirname, './src'), + // }, + }, + build: { + manifest: true, + outDir: 'dist', + emptyOutDir: true, + sourcemap: true, }, })