mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Add vite build (#53)
* Add vite build - baseline * Fix build output folder structure Matches pre-vite output * Fix litegraph errors introduced by vite process - Remove pre-written encapsulating iife (one is injected by vite) - Replace all references to the global "this" with globalThis
This commit is contained in:
21
vite.config.mts
Normal file
21
vite.config.mts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import path from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/litegraph.js'),
|
||||
name: 'litegraph.js',
|
||||
// TODO: Below workaround ensures output matches pre-vite format. Should be removed.
|
||||
fileName: (moduleFormat, entryAlias) => 'src/litegraph.js',
|
||||
formats: ['iife']
|
||||
},
|
||||
minify: false,
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
// Disabling tree-shaking
|
||||
// Prevent vite remove unused exports
|
||||
treeshake: false
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user