diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 0970bc08e..b5f2b3757 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -99,6 +99,8 @@ There are other breaking changes which only affect few users. - This PR not only introduces a breaking change mentioned above as "Default value for `resolve.conditions`", but also makes `resolve.mainFields` to not be used for no-externalized dependencies in SSR. If you were using `resolve.mainFields` and want to apply that to no-externalized dependencies in SSR, you can use [`ssr.resolve.mainFields`](/config/ssr-options#ssr-resolve-mainfields). - [[#18493] refactor!: remove fs.cachedChecks option](https://github.com/vitejs/vite/pull/18493) - This opt-in optimization was removed due to edge cases when writing a file in a cached folder and immediately importing it. +- [[#18697] fix(deps)!: update dependency dotenv-expand to v12](https://github.com/vitejs/vite/pull/18697) + - Variables used in interpolation should be declared before the interpolation now. For more details, see [the `dotenv-expand` changelog](https://github.com/motdotla/dotenv-expand/blob/v12.0.1/CHANGELOG.md#1200-2024-11-16). ## Migration from v4 diff --git a/packages/vite/package.json b/packages/vite/package.json index 1c05ea145..006c8b8d9 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -116,7 +116,7 @@ "debug": "^4.3.7", "dep-types": "link:./src/types", "dotenv": "^16.4.5", - "dotenv-expand": "^11.0.7", + "dotenv-expand": "^12.0.1", "es-module-lexer": "^1.5.4", "escape-html": "^1.0.3", "estree-walker": "^3.0.3", diff --git a/playground/env/.env b/playground/env/.env index bca550ecc..db7181dff 100644 --- a/playground/env/.env +++ b/playground/env/.env @@ -2,10 +2,10 @@ VITE_CUSTOM_ENV_VARIABLE=1 CUSTOM_PREFIX_ENV_VARIABLE=1 VITE_EFFECTIVE_MODE_FILE_NAME=.env VITE_BOOL=true +DEPEND_ENV=depend VITE_EXPAND_A=$EXPAND VITE_EXPAND_B=$DEPEND_ENV VITE_ESCAPE_A=escape\$ VITE_ESCAPE_B=escape$ IRRELEVANT_ENV=$DEPEND_ENV IRRELEVANT_ESCAPE_ENV=irrelevant$ -DEPEND_ENV=depend diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5e1b8ce6..101f2ac51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -304,8 +304,8 @@ importers: specifier: ^16.4.5 version: 16.4.5 dotenv-expand: - specifier: ^11.0.7 - version: 11.0.7 + specifier: ^12.0.1 + version: 12.0.1 es-module-lexer: specifier: ^1.5.4 version: 1.5.4 @@ -4369,8 +4369,8 @@ packages: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} - dotenv-expand@11.0.7: - resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} + dotenv-expand@12.0.1: + resolution: {integrity: sha512-LaKRbou8gt0RNID/9RoI+J2rvXsBRPMV7p+ElHlPhcSARbCPDYcYG2s1TIzAfWv4YSgyY5taidWzzs31lNV3yQ==} engines: {node: '>=12'} dotenv@16.4.5: @@ -10073,7 +10073,7 @@ snapshots: dependencies: is-obj: 2.0.0 - dotenv-expand@11.0.7: + dotenv-expand@12.0.1: dependencies: dotenv: 16.4.5