You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/env-and-mode.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@
2
2
3
3
Vite expone ciertas constantes bajo el objeto especial `import.meta.env`. Estas constantes se definen como variables globales durante el desarrollo y se reemplazan estáticamente en el momento de la compilación para que el tree-shaking sea efectivo.
4
4
5
+
:::details Example
6
+
7
+
```js
8
+
if (import.meta.env.DEV) {
9
+
// El código aquí dentro se someterá a tree-shaking en las compilaciones de producción.
10
+
console.log('Devmode')
11
+
}
12
+
```
13
+
14
+
:::
15
+
5
16
## Constantes Incorporadas
6
17
7
18
Algunas constantes incorporadas están disponibles en todos los casos:
0 commit comments