Files
ComfyUI_frontend/vite.config.mts
Chenlei Hu 3fbb75ce76 Configure vite to copy from src to dist (#2)
* nit

* move

* direct copy lib dir

* nit

* disable treeshake
2024-06-13 23:09:10 -04:00

38 lines
748 B
TypeScript

import { defineConfig } from 'vite';
import noBundlePlugin from 'vite-plugin-no-bundle';
export default defineConfig({
server: {
open: true,
proxy: {
// Proxy websocket requests to the server
'/': {
target: 'ws://127.0.0.1:8188',
ws: true,
}
}
},
plugins: [noBundlePlugin({
copy: [
'**/*.css',
'lib/*.js',
// Make sure to include all core extensions, as they are loaded dynamically
'extensions/core/*.js',
// Include modules only used by core extensions
'scripts/ui/draggableList.js',
]
})],
build: {
lib: {
formats: ['es'],
entry: 'index.html',
},
minify: false,
rollupOptions: {
// Disabling tree-shaking
// Prevent vite remove unused exports
treeshake: false
}
},
});