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/config/index.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,14 @@ vite --config my-config.js
24
24
```
25
25
26
26
::: tip NOTE
27
-
Vite will replace`__filename`, `__dirname`, and `import.meta.url`in config files and its deps. Using these as variable names or passing as a parameter to a function with string double quote (example `console.log`) will result in an error:
27
+
Vite will inject`__filename`, `__dirname`in config files and its deps. Declaring these variables at top level will result in an error:
28
28
29
29
```js
30
-
const__filename="value"
31
-
// will be transformed to
32
-
const "path/vite.config.js" ="value"
30
+
const__filename='value'// SyntaxError: Identifier '__filename' has already been declared
33
31
34
-
console.log("import.meta.url") // break error on build
0 commit comments