Skip to content

Commit

Permalink
fix components build
Browse files Browse the repository at this point in the history
  • Loading branch information
prichodko committed Sep 17, 2024
1 parent 47706c6 commit 0b24354
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"compilerOptions": {
"jsx": "preserve",
"outDir": "./dist",
"tsBuildInfoFile": "node_modules/.cache"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo"
},
"references": []
}
13 changes: 9 additions & 4 deletions packages/components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ import react from '@vitejs/plugin-react-swc'
import { preserveDirectives } from 'rollup-plugin-preserve-directives'
import { defineConfig } from 'vite'

import { dependencies, peerDependencies } from './package.json'
import { dependencies, devDependencies, peerDependencies } from './package.json'

const external = [
...Object.keys(dependencies || {}),
...Object.keys(peerDependencies || {}),
'tailwindcss',
...Object.keys(devDependencies || {}),
].map(name => new RegExp(`^${name}(/.*)?`))

export default defineConfig(({ mode }) => {
return {
build: {
target: 'es2020',
lib: {
entry: ['./src/index.tsx', './tailwind.config.ts'],
entry: {
'src/index': './src/index.tsx',
'tailwind.config': './tailwind.config.ts',
},
formats: ['es', 'cjs'],
fileName: (format, entryName) => `${entryName}.${format}.js`,
fileName: format => {
return `[name].${format}.js`
},
},
sourcemap: true,
emptyOutDir: mode === 'production',
Expand Down

0 comments on commit 0b24354

Please sign in to comment.