Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated by Copilot at f737a2b
This pull request adds support for copying public and upload assets using both webpack and rspack bundlers in the
@modern-js/app-tools
package. It introduces a new rspack plugin adapter, refactors some common logic to shared functions and files, and updates the tests and changeset accordingly.Details
🤖 Generated by Copilot at f737a2b
@modern-js/app-tools
package (link)createRspackBuilderForModern
function to add thebuilderPluginAdpaterCopy
to the builder instance (link,link)createPublicPattern
andcreateUploadPattern
from a new filecreateCopyPattern.ts
to create the copy patterns for the public and upload assets respectively, using the webpack chain and the app context and config (link)createCopyPattern
function with thecreatePublicPattern
andcreateUploadPattern
functions in thebuilderPluginCompatModern
andcreateOutputConfig
functions respectively, to make the function names more specific and consistent (link,link,link,link)createCopyPattern
file and remove its export from theshared
index file (link,link)createCopyInfo
from a new filecreateCopyInfo.ts
to return the config, upload, and public directories based on the app context and config, and use it by both webpack and rspack bundlers (link,link)modern.config.ts
file in thecopy-public-html
fixture to support both webpack and rspack bundlers using an environment variableBUNDLER
(link)index.test.ts
file in thecopy-assets
test to run the test for both webpack and rspack bundlers using theBUNDLER
variable, and use a helper functiontestPublicHtml
to avoid code duplication (link)opts.env
option to themodernBuild
function in themodernTestUtils.js
file to allow passing custom environment variables to the build command (link)Related Issue
Checklist
pnpm run change
.