mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 00:20:07 +00:00
Remove #private field declarations from generated .d.ts files to prevent TypeScript compatibility issues when using @comfyorg/comfyui-frontend-types alongside @comfyorg/litegraph packages. Fixes #5033 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
1023 B
TypeScript
36 lines
1023 B
TypeScript
import { resolve } from 'path'
|
|
import { defineConfig } from 'vite'
|
|
import dts from 'vite-plugin-dts'
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/types/index.ts'),
|
|
name: 'comfyui-frontend-types',
|
|
formats: ['es'],
|
|
fileName: 'index'
|
|
},
|
|
copyPublicDir: false,
|
|
minify: false
|
|
},
|
|
|
|
plugins: [
|
|
dts({
|
|
copyDtsFiles: true,
|
|
rollupTypes: true,
|
|
tsconfigPath: 'tsconfig.types.json',
|
|
beforeWriteFile: (filePath, content) => {
|
|
// Remove #private field declarations to prevent conflicts with external packages
|
|
// This fixes issue #5033 where #private fields cause type incompatibility
|
|
const cleanedContent = content
|
|
.replace(/\s*#private;\s*/g, '') // Remove "#private;" declarations
|
|
.replace(/\s*#[a-zA-Z_$][a-zA-Z0-9_$]*\s*:\s*[^;]+;\s*/g, '') // Remove full private field declarations
|
|
return {
|
|
filePath,
|
|
content: cleanedContent
|
|
}
|
|
}
|
|
})
|
|
]
|
|
})
|