wip: adding build step

This commit is contained in:
Juan Di Toro 2023-10-07 18:29:36 +02:00
parent 4e4ced81ba
commit c043c5b6a1
2 changed files with 36 additions and 10 deletions

18
tsconfig.build.json Normal file
View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"composite": true,
"typeRoots": ["src/vite-env.d.ts"]
},
"include": [
"src"
],
"exclude": [
"**/*.stories.tsx"
],
"references": [
{
"path": "./tsconfig.json"
}
]
}

View File

@ -1,20 +1,28 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import scopeTailwind from "vite-plugin-scope-tailwind"; import scopeTailwind from "vite-plugin-scope-tailwind";
import { resolve } from 'path' // import { resolve } from 'path'
// import reactTailwindClassnamePrefixer from "./lib/vite-plugin-react-classname-prefixer";
import svgr from "vite-plugin-svgr"; import svgr from "vite-plugin-svgr";
import dts from 'vite-plugin-dts'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [svgr(), react(), scopeTailwind({react: true})], plugins: [svgr(), react(), scopeTailwind({react: true}), dts({
tsconfigPath: "tsconfig.build.json"
})],
resolve: { resolve: {
// I have no clue why aliases are not working at all... // TODO: For some reason aliases are not working....
alias: { // alias: {
'@styles/': resolve(__dirname, './styles'), // '@styles/': resolve(__dirname, './styles'),
'@components/': resolve(__dirname, './src/components'), // '@components/': resolve(__dirname, './src/components'),
'@assets/': resolve(__dirname, './src/assets'), // '@assets/': resolve(__dirname, './src/assets'),
'@': resolve(__dirname, './src'), // '@': resolve(__dirname, './src'),
// },
}, },
build: {
manifest: true,
outDir: 'dist',
emptyOutDir: true,
sourcemap: true,
}, },
}) })