@@ -48,13 +48,11 @@ function generateHtmlEntries(): Plugin {
4848 const components = discoverComponents ( ) ;
4949 const template = readFileSync ( templatePath , "utf-8" ) ;
5050
51- // Ensure entries directory exists
5251 if ( ! existsSync ( entriesDir ) ) {
5352 mkdirSync ( entriesDir , { recursive : true } ) ;
5453 }
5554
5655 for ( const componentName of components ) {
57- // Generate HTML by replacing placeholders in template
5856 const html = template
5957 . replace ( "{{COMPONENT_NAME}}" , componentName )
6058 . replace ( "{{TITLE}}" , componentName . replace ( / ( [ A - Z ] ) / g, " $1" ) . trim ( ) ) // "ListDatabases" -> "List Databases"
@@ -70,13 +68,10 @@ function generateHtmlEntries(): Plugin {
7068
7169const components = discoverComponents ( ) ;
7270
73- // https://vitejs.dev/config/
7471export default defineConfig ( {
75- // Set root to entries directory so output paths are relative to it
7672 root : entriesDir ,
7773 plugins : [
7874 generateHtmlEntries ( ) ,
79- // Cast to PluginOption due to Vite version mismatch in plugin types
8075 nodePolyfills ( {
8176 include : [ "buffer" , "stream" ] ,
8277 globals : {
@@ -89,7 +84,6 @@ export default defineConfig({
8984 } ) ,
9085 ] ,
9186 build : {
92- // Output relative to project root, not the Vite root
9387 outDir : resolve ( __dirname , "dist/ui" ) ,
9488 emptyOutDir : true ,
9589 rollupOptions : {
0 commit comments