mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +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
|
DEPLOY_COMFYUI_DIR=/home/ComfyUI/web
|
||||||
|
|
||||||
# The directory containing the ComfyUI_examples repo used to extract test workflows.
|
# 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();
|
dotenv.config();
|
||||||
|
|
||||||
const IS_DEV = process.env.NODE_ENV === 'development';
|
const IS_DEV = process.env.NODE_ENV === 'development';
|
||||||
|
const SHOULD_MINIFY = process.env.ENABLE_MINIFY !== 'false';
|
||||||
|
|
||||||
interface ShimResult {
|
interface ShimResult {
|
||||||
code: string;
|
code: string;
|
||||||
@@ -111,7 +112,7 @@ export default defineConfig({
|
|||||||
comfyAPIPlugin(),
|
comfyAPIPlugin(),
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
minify: 'esbuild',
|
minify: SHOULD_MINIFY ? 'esbuild' : false,
|
||||||
target: 'es2015',
|
target: 'es2015',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
@@ -123,8 +124,8 @@ export default defineConfig({
|
|||||||
esbuild: {
|
esbuild: {
|
||||||
minifyIdentifiers: false,
|
minifyIdentifiers: false,
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
minifySyntax: true,
|
minifySyntax: SHOULD_MINIFY,
|
||||||
minifyWhitespace: true,
|
minifyWhitespace: SHOULD_MINIFY,
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
'__COMFYUI_FRONTEND_VERSION__': JSON.stringify(process.env.npm_package_version),
|
'__COMFYUI_FRONTEND_VERSION__': JSON.stringify(process.env.npm_package_version),
|
||||||
|
|||||||
Reference in New Issue
Block a user