remove console logs from production builds
This commit is contained in:
+3
-3
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite --host=0.0.0.0",
|
||||
"dev:ssl": "VITE_USE_SSL=true vite --host=0.0.0.0",
|
||||
"build": "pnpm run spacetime:generate && tsc -b && vite build",
|
||||
"build": "pnpm run spacetime:generate && tsc -b && NODE_ENV=production vite build",
|
||||
"lint": "eslint . --fix",
|
||||
"format": "prettier . --write",
|
||||
"test": "vitest run",
|
||||
@@ -14,8 +14,8 @@
|
||||
"spacetime:publish": "spacetime publish --module-path spacetimedb",
|
||||
"spacetime:publish:local": "spacetime publish --module-path spacetimedb --server local",
|
||||
"stress": "tsx utils/stress.ts",
|
||||
"deploy:local": "docker compose -f docker-compose.local.yml up --build",
|
||||
"deploy:cloudflare": "pnpm run build && wrangler deploy"
|
||||
"deploy:local": "NODE_ENV=production docker compose -f docker-compose.local.yml up --build",
|
||||
"deploy:cloudflare": "NODE_ENV=production pnpm run build && wrangler deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^7.2.0",
|
||||
|
||||
+5
-2
@@ -5,7 +5,7 @@ import basicSsl from "@vitejs/plugin-basic-ssl";
|
||||
import { cloudflare } from "@cloudflare/vite-plugin";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ mode }) => ({
|
||||
plugins: [
|
||||
process.env.VITE_USE_SSL === "true" ? basicSsl() : [],
|
||||
svelte(),
|
||||
@@ -20,4 +20,7 @@ export default defineConfig({
|
||||
port: process.env.VITE_USE_SSL === "true" ? 5174 : 5173,
|
||||
host: "0.0.0.0",
|
||||
},
|
||||
});
|
||||
esbuild: {
|
||||
drop: mode === "production" ? ["console", "debugger"] : [],
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user