From b038fe4f597c4303fadfee66c7367305464af4c4 Mon Sep 17 00:00:00 2001 From: Marvin Alexander Krebber Date: Thu, 9 Jan 2025 20:04:31 +0100 Subject: [PATCH] disable minification on dev command --- package.json | 8 ++++---- vite.config.ts | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 791fd12..fdfe433 100644 --- a/package.json +++ b/package.json @@ -89,11 +89,11 @@ }, "scripts": { "build": "npm run build:chrome && npm run build:firefox", - "build:chrome": "cross-env NODE_ENV=production vite build -c vite.chrome.config.ts", - "build:firefox": "cross-env NODE_ENV=production vite build -c vite.firefox.config.ts", + "build:chrome": "cross-env MINIFY=true NODE_ENV=production vite build -c vite.chrome.config.ts", + "build:firefox": "cross-env MINIFY=true NODE_ENV=production vite build -c vite.firefox.config.ts", "dev": "concurrently \"npm run dev:chrome\" \"npm run dev:firefox\"", - "dev:chrome": "cross-env NODE_ENV=development vite -c vite.chrome.config.ts", - "dev:firefox": "cross-env NODE_ENV=development vite build --mode development --watch -c vite.firefox.config.ts", + "dev:chrome": "cross-env MINIFY=false NODE_ENV=development vite -c vite.chrome.config.ts", + "dev:firefox": "cross-env MINIFY=false NODE_ENV=development vite build --mode development --watch -c vite.firefox.config.ts", "format": "prettier --write .", "launch": "tsx scripts/launch.ts", "launch:all": "tsx scripts/launch.ts --all", diff --git a/vite.config.ts b/vite.config.ts index cecf85b..08d06cf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,6 +17,8 @@ import { dirname, relative, resolve } from "node:path" import "dotenv/config" const PORT = Number(process.env.PORT || "") || 3303 +const shouldMinify = process.env.MINIFY === "true" +console.log("MINIFY", shouldMinify) function getImmediateDirectories(dirPath: string): string[] { try { @@ -173,6 +175,7 @@ export default defineConfig({ devtoolsPanel: "src/ui/devtools-panel/index.html", }, }, + minify: shouldMinify, }, server: {