Skip to content

Commit

Permalink
fix: automatic dev mode detection (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge authored Dec 30, 2024
1 parent 92e8fdf commit 15868e3
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-stingrays-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
uploadthing: patch
---

fix automatic dev mode detection
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"pnpm": {
"patchedDependencies": {
"msw@2.2.13": "patches/msw@2.2.13.patch",
"@mswjs/interceptors@0.26.15": "patches/@mswjs__interceptors@0.26.15.patch"
"@mswjs/interceptors@0.26.15": "patches/@mswjs__interceptors@0.26.15.patch",
"bunchee@6.1.2": "patches/bunchee@6.1.2.patch"
}
}
}
34 changes: 34 additions & 0 deletions patches/bunchee@6.1.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/dist/index.js b/dist/index.js
index 4cadc4dd7e95da967da5b897ba8d20dae25bf7c1..2c742f6da291d5f66aed0033ff5dc1ea2a6f12d4 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1068,9 +1068,9 @@ async function writeDefaultTsconfig(tsConfigPath) {
/**
* @return {Record<string, string>} env { 'process.env.<key>': '<value>' }
*/ function getDefinedInlineVariables(envs, parsedExportCondition) {
- if (!envs.includes('NODE_ENV')) {
- envs.push('NODE_ENV');
- }
+ // if (!envs.includes('NODE_ENV')) {
+ // envs.push('NODE_ENV');
+ // }
const envVars = envs.reduce((acc, key)=>{
const value = process.env[key];
if (typeof value !== 'undefined') {
@@ -1087,11 +1087,11 @@ async function writeDefaultTsconfig(tsConfigPath) {
return acc;
}, new Set());
// For development and production convention, we override the NODE_ENV value
- if (exportConditionNames.has('development')) {
- envVars['process.env.NODE_ENV'] = JSON.stringify('development');
- } else if (exportConditionNames.has('production')) {
- envVars['process.env.NODE_ENV'] = JSON.stringify('production');
- }
+ // if (exportConditionNames.has('development')) {
+ // envVars['process.env.NODE_ENV'] = JSON.stringify('development');
+ // } else if (exportConditionNames.has('production')) {
+ // envVars['process.env.NODE_ENV'] = JSON.stringify('production');
+ // }
if (exportConditionNames.has('edge-light')) {
envVars['EdgeRuntime'] = JSON.stringify('edge-runtime');
}
17 changes: 10 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15868e3

Please sign in to comment.