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