Skip to content

Keep the user's package.json when loading a script - #2579

Merged
soulgalore merged 1 commit into
mainfrom
keep-user-package-json
Oct 18, 2026
Merged

soulgalore merged 1 commit into
mainfrom
keep-user-package-json

Conversation

@soulgalore

Copy link
Copy Markdown
Member

To load a .js script as CommonJS, Browsertime wrote an empty package.json next to the script and then deleted it. If the folder already had a package.json, it was overwritten and then deleted, so the user lost their file.

Now the temporary file is only created when no package.json exists, and only that temporary file is removed.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

To load a .js script as CommonJS, Browsertime wrote an empty package.json next to the script and then deleted it. If the folder already had a package.json, it was overwritten and then deleted, so the user lost their file.

Now the temporary file is only created when no package.json exists, and only that temporary file is removed.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com
@soulgalore
soulgalore merged commit e834ee3 into main Oct 18, 2026
19 of 20 checks passed
@soulgalore
soulgalore deleted the keep-user-package-json branch October 18, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant