Skip to content

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ydcjeff committed Mar 5, 2022
1 parent a47ac01 commit 3c6a763
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ vite --config my-config.js
```

::: tip NOTE
Vite will only replace `__filename`, `__dirname`, and `import.meta.url` in **CommonJS context** and **TS config file** (whether there is `type: "module"` or not). Using these as variable names will result in an error:
:::
Vite will only replace `__filename`, `__dirname`, and `import.meta.url` in **CommonJS** and **TypeScript** config files. Using these as variable names will result in an error:

```js
const __filename = "value"
// will be transformed to
const "path/vite.config.js" = "value"
```

:::

### Config Intellisense

Since Vite ships with TypeScript typings, you can leverage your IDE's intellisense with jsdoc type hints:
Expand Down

0 comments on commit 3c6a763

Please sign in to comment.