Skip to content

Commit 897f69f

Browse files
authored
docs: add env var section (vitejs#11286)
1 parent 83abd37 commit 897f69f

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export default defineConfig({
238238
link: '/guide/troubleshooting',
239239
},
240240
{
241-
text: 'Migration from v2',
241+
text: 'Migration from v3',
242242
link: '/guide/migration',
243243
},
244244
],

docs/blog/announcing-vite4.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Note that Vite starter templates are intended to be used as a playground to test
7171

7272
The modern browser build now targets `safari14` by default for wider ES2020 compatibility. This means that modern builds can now use [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) and that the [nullish coalescing operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) isn't transpiled anymore. If you need to support older browsers, you can add [`@vitejs/plugin-legacy`](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) as usual.
7373

74-
## Importing CSS as a string
74+
## Importing CSS as a String
7575

7676
In Vite 3, importing the default export of a `.css` file could introduce a double loading of CSS.
7777

@@ -87,7 +87,18 @@ import stuff from './global.css?inline'
8787

8888
Learn more in the [Migration Guide](/guide/migration).
8989

90-
## Other features
90+
## Environment Variables
91+
92+
Vite now uses `dotenv` 16 and `dotenv-expand` 9 (previously `dotenv` 14 and `dotenv-expand` 5). If you have a value including `#` or `` ` ``, you will need to wrap them with quotes.
93+
94+
```diff
95+
-VITE_APP=ab#cd`ef
96+
+VITE_APP="ab#cd`ef"
97+
```
98+
99+
For more details, see the [`dotenv`](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) and [`dotenv-expand` changelog](https://github.com/motdotla/dotenv-expand/blob/master/CHANGELOG.md).
100+
101+
## Other Features
91102

92103
- CLI Shortcuts (press `h` during dev to see them all) ([#11228](https://github.com/vitejs/vite/pull/11228))
93104
- Support for patch-package when pre bundling dependencies ([#10286](https://github.com/vitejs/vite/issues/10286))

docs/guide/migration.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The modern browser build now targets `safari14` by default for wider ES2020 comp
1616

1717
The build default charset is now utf8 (see [#10753](https://github.com/vitejs/vite/issues/10753) for details).
1818

19-
### Importing CSS as a string
19+
### Importing CSS as a String
2020

2121
In Vite 3, importing the default export of a `.css` file could introduce a double loading of CSS.
2222

@@ -30,11 +30,16 @@ This double loading could occur since a `.css` file will be emitted and it's lik
3030
import stuff from './global.css?inline'
3131
```
3232

33-
### `dotenv` update
33+
### Environment Variables
3434

35-
Vite is now using dotenv 16 and dotenv-expand 9 (previously dotenv 14 and dotenv-expand 5).
35+
Vite now uses `dotenv` 16 and `dotenv-expand` 9 (previously `dotenv` 14 and `dotenv-expand` 5). If you have a value including `#` or `` ` ``, you will need to wrap them with quotes.
3636

37-
If you have a value including `#` or `` ` ``, you will need to wrap them with quotes. See their changelog for more details ([`dotenv`](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md), [`dotenv-expand`](https://github.com/motdotla/dotenv-expand/blob/master/CHANGELOG.md)).
37+
```diff
38+
-VITE_APP=ab#cd`ef
39+
+VITE_APP="ab#cd`ef"
40+
```
41+
42+
For more details, see the [`dotenv`](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) and [`dotenv-expand` changelog](https://github.com/motdotla/dotenv-expand/blob/master/CHANGELOG.md).
3843

3944
## Advanced
4045

0 commit comments

Comments
 (0)