mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Control minify with env var (#445)
This commit is contained in:
@@ -13,4 +13,7 @@ DEV_SERVER_COMFYUI_URL=http://127.0.0.1:8188
|
||||
DEPLOY_COMFYUI_DIR=/home/ComfyUI/web
|
||||
|
||||
# The directory containing the ComfyUI_examples repo used to extract test workflows.
|
||||
EXAMPLE_REPO_PATH=tests-ui/ComfyUI_examples
|
||||
EXAMPLE_REPO_PATH=tests-ui/ComfyUI_examples
|
||||
|
||||
# Whether to enable minification of the frontend code.
|
||||
ENABLE_MINIFY=true
|
||||
@@ -5,6 +5,7 @@ import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
const IS_DEV = process.env.NODE_ENV === 'development';
|
||||
const SHOULD_MINIFY = process.env.ENABLE_MINIFY !== 'false';
|
||||
|
||||
interface ShimResult {
|
||||
code: string;
|
||||
@@ -111,7 +112,7 @@ export default defineConfig({
|
||||
comfyAPIPlugin(),
|
||||
],
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
minify: SHOULD_MINIFY ? 'esbuild' : false,
|
||||
target: 'es2015',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
@@ -123,8 +124,8 @@ export default defineConfig({
|
||||
esbuild: {
|
||||
minifyIdentifiers: false,
|
||||
keepNames: true,
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
minifySyntax: SHOULD_MINIFY,
|
||||
minifyWhitespace: SHOULD_MINIFY,
|
||||
},
|
||||
define: {
|
||||
'__COMFYUI_FRONTEND_VERSION__': JSON.stringify(process.env.npm_package_version),
|
||||
|
||||
Reference in New Issue
Block a user