-
Notifications
You must be signed in to change notification settings - Fork 472
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support minifyoptions extract comments #2882
feat: support minifyoptions extract comments #2882
Conversation
馃 Changeset detectedLatest commit: 60e2295 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
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 |
crates/rspack_plugin_javascript/tests/fixtures/builtins/minify/test.config.json
Show resolved
Hide resolved
!bench |
Benchmark Results
|
crates/rspack_plugin_javascript/tests/fixtures/builtins/minify/expected/main.js.License.txt
Outdated
Show resolved
Hide resolved
Overall, looks good to me, would you mind rebasing the main branch, so I could approve and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* chore: init * feat: support regex match * chore: clear comments in minimized file * chore: update * chore: no license no LICENSE.TXT * test: add test cases * test: add comments for expected * chore: update * chore: remove comments * chore: add expected file * chore: add comments * chore: changeset * chore: comment * chore: update snapshots * chore: update * chore: resolve config * chore: update filename * chore: update name * chore: update name
Related issue (if exists)
closed #2772
Summary
馃 Generated by Copilot at fe03709
This pull request adds a new feature to the rspack bundler that allows extracting comments from minified JavaScript code and emitting them as separate assets. It modifies the
rspack_plugin_javascript
crate, therspack_binding_options
crate, therspack_core
crate, and therspack
package to support this feature. It also updates theexamples/basic
folder to demonstrate the usage of this feature.Walkthrough
馃 Generated by Copilot at fe03709
stringify
function to optionally omit the comments from the output code based on aretain_comments
flag (link, link)retain_comments
flag to thestringify
function from thegenerate
method of theJavaScriptParserAndGenerator
struct (link)ExtractedCommentsInfo
to store the information about the extracted comments for a file (link)rspack.config.js
in theexamples/basic
folder to enable the comment extraction feature and set the regular expression for theextractComments
field (link)index.js
in theexamples/basic/src
folder to contain various types of comments for testing purposes (link)minify
function and thefrom
method of theRawMinification
struct for testing purposes (link, link, link)minify.rs
andplugin.rs
files to use the new types and modules (link, link, link)minify.rs
andvisitors.rs
files for formatting purposes (link, link, link)