diff --git a/package.json b/package.json index f0be74648b92fb..b031400b4a8be3 100644 --- a/package.json +++ b/package.json @@ -118,9 +118,9 @@ } }, "patchedDependencies": { - "dotenv-expand@9.0.0": "patches/dotenv-expand@9.0.0.patch", "chokidar@3.5.3": "patches/chokidar@3.5.3.patch", - "sirv@2.0.3": "patches/sirv@2.0.3.patch" + "sirv@2.0.3": "patches/sirv@2.0.3.patch", + "dotenv-expand@10.0.0": "patches/dotenv-expand@10.0.0.patch" }, "peerDependencyRules": { "allowedVersions": { diff --git a/packages/vite/package.json b/packages/vite/package.json index fa14286b69a302..5fbee60497c9f4 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -104,7 +104,7 @@ "debug": "^4.3.4", "dep-types": "link:./src/types", "dotenv": "^16.3.1", - "dotenv-expand": "^9.0.0", + "dotenv-expand": "^10.0.0", "es-module-lexer": "^1.3.0", "escape-html": "^1.0.3", "estree-walker": "^3.0.3", diff --git a/packages/vite/rollup.config.ts b/packages/vite/rollup.config.ts index 5b4d51052b8c20..837b1b165dd658 100644 --- a/packages/vite/rollup.config.ts +++ b/packages/vite/rollup.config.ts @@ -195,7 +195,7 @@ function createCjsConfig(isProduction: boolean) { ...Object.keys(pkg.dependencies), ...(isProduction ? [] : Object.keys(pkg.devDependencies)), ], - plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(161)], + plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(162)], }) } diff --git a/patches/dotenv-expand@10.0.0.patch b/patches/dotenv-expand@10.0.0.patch new file mode 100644 index 00000000000000..ae483e0f3d3c7c --- /dev/null +++ b/patches/dotenv-expand@10.0.0.patch @@ -0,0 +1,18 @@ +diff --git a/lib/main.js b/lib/main.js +index 79d973c22f06403bfee45ff122bd384841c30da8..9392de262140f8f336146bef2419794532e4170f 100644 +--- a/lib/main.js ++++ b/lib/main.js +@@ -69,9 +69,10 @@ function expand (config) { + ) + } + +- for (const processKey in config.parsed) { +- environment[processKey] = config.parsed[processKey] +- } ++ // PATCH: don't write to process.env ++ // for (const processKey in config.parsed) { ++ // environment[processKey] = config.parsed[processKey] ++ // } + + return config + } \ No newline at end of file diff --git a/patches/dotenv-expand@9.0.0.patch b/patches/dotenv-expand@9.0.0.patch deleted file mode 100644 index 979879e22a602c..00000000000000 --- a/patches/dotenv-expand@9.0.0.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/lib/main.js b/lib/main.js -index c873cc77229d4cd0cf9de98ae0970b25d89f312f..901758c6b665d2935501404fc09c6abd94b7eb1e 100644 ---- a/lib/main.js -+++ b/lib/main.js -@@ -17,6 +17,10 @@ function _interpolate (envValue, environment, config) { - replacePart = parts[0] - value = replacePart.replace('\\$', '$') - } else { -+ // PATCH: compatible with env variables ended with unescaped $ -+ if(!parts[2]) { -+ return newEnv -+ } - const keyParts = parts[2].split(':-') - const key = keyParts[0] - replacePart = parts[0].substring(prefix.length) -@@ -50,9 +54,10 @@ function expand (config) { - config.parsed[configKey] = _interpolate(value, environment, config) - } - -- for (const processKey in config.parsed) { -- environment[processKey] = config.parsed[processKey] -- } -+ // PATCH: don't write to process.env -+ // for (const processKey in config.parsed) { -+ // environment[processKey] = config.parsed[processKey] -+ // } - - return config - } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b97fa97cbc42b..3e9605c79e0361 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,9 +13,9 @@ patchedDependencies: chokidar@3.5.3: hash: dzxbf3kgof5pdmbsyih2x43sq4 path: patches/chokidar@3.5.3.patch - dotenv-expand@9.0.0: - hash: dccccn23nvejzy75sgiosdt2au - path: patches/dotenv-expand@9.0.0.patch + dotenv-expand@10.0.0: + hash: weuqf2vlv5b5g6cikeo4slurbm + path: patches/dotenv-expand@10.0.0.patch sirv@2.0.3: hash: z45f224eewh2pgpijxcc3aboqm path: patches/sirv@2.0.3.patch @@ -313,8 +313,8 @@ importers: specifier: ^16.3.1 version: 16.3.1 dotenv-expand: - specifier: ^9.0.0 - version: 9.0.0(patch_hash=dccccn23nvejzy75sgiosdt2au) + specifier: ^10.0.0 + version: 10.0.0(patch_hash=weuqf2vlv5b5g6cikeo4slurbm) es-module-lexer: specifier: ^1.3.0 version: 1.3.0 @@ -5508,8 +5508,8 @@ packages: is-obj: 2.0.0 dev: true - /dotenv-expand@9.0.0(patch_hash=dccccn23nvejzy75sgiosdt2au): - resolution: {integrity: sha512-uW8Hrhp5ammm9x7kBLR6jDfujgaDarNA02tprvZdyrJ7MpdzD1KyrIHG4l+YoC2fJ2UcdFdNWNWIjt+sexBHJw==} + /dotenv-expand@10.0.0(patch_hash=weuqf2vlv5b5g6cikeo4slurbm): + resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} engines: {node: '>=12'} dev: true patched: true