Skip to content

Commit d7c04e8

Browse files
authored
docs(config-file): update tip note about string replace (#7846)
1 parent e56d79e commit d7c04e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/config/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ vite --config my-config.js
2828
```
2929

3030
::: tip NOTE
31-
Vite will replace `__filename`, `__dirname`, and `import.meta.url` in config files and its deps. Using these as variable names will result in an error:
31+
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:
3232

3333
```js
3434
const __filename = "value"
3535
// will be transformed to
3636
const "path/vite.config.js" = "value"
37+
38+
console.log("import.meta.url") // break error on build
3739
```
3840

3941
:::

0 commit comments

Comments
 (0)