developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8.03k stars 362 forks source link

fix: Fix problems related to use terser nameCache #966

Open zyrong opened 2 years ago

zyrong commented 2 years ago
  1. The nameCache obtained in writebundle hook is not a reference to terseroptions
  2. JSON.stringify(nameCache) requires converting regex to a string first.

This commit fixes the problems related to terser namecache. When terser compresses the code, the damaged variable names will be written to the namecache. Finally, the namecache will be written to the file system in this code, but after my test, it doesn't seem to work here

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 685962db5ad092bd38f33f86209eea6ee44269bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------- | ----- | | microbundle | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR