Skip to content

Commit

Permalink
chore: format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaskuske committed Apr 10, 2022
1 parent a5fc57f commit 145c1df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default defineConfig(({ command, mode }) => {
- To be consistent with [esbuild behavior](https://esbuild.github.io/api/#define), expressions must either be a JSON object (null, boolean, number, string, array, or object) or a single identifier.

::: warning
Because it's implemented as straightforward [RegExp-based](https://github.com/vitejs/vite/blob/4aecf7dc6df6878b7de3c395a0a9ec8fc0f6a1af/packages/vite/src/node/plugins/define.ts#L70-L87) text replacements without any syntax analysis, we recommend using `define` for CONSTANTS only.
Because it's implemented as straightforward [RegExp-based](https://github.com/vitejs/vite/blob/4aecf7dc6df6878b7de3c395a0a9ec8fc0f6a1af/packages/vite/src/node/plugins/define.ts#L70-L87) text replacements without any syntax analysis, we recommend using `define` for CONSTANTS only.

For example, `process.env.FOO` and `__APP_VERSION__` are good fits. But `process` or `global` should not be put into this option. Variables can be shimmed or polyfilled instead.
:::
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/define/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ module.exports = {
'process.env.SOMEVAR': '"SOMEVAR"',
$DOLLAR: 456,
ÖUNICODE_LETTERɵ: 789,
__VAR_NAME__: false,
__VAR_NAME__: false
}
}

0 comments on commit 145c1df

Please sign in to comment.