Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: automatic dev mode detection #1106

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading