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.
Related issue (if exists)
part of #2610
Summary
🤖 Generated by Copilot at 72d58f6
This pull request refactors the code related to the
assets
field of theCompilation
struct and its wrappers, and adds support for tracking and including assets information in the statistics and the output of the compilation. It also introduces minor improvements to some plugins and structs that use or produce assets. The main files affected arecrates/rspack_core/src/compiler/compilation.rs
,crates/rspack_core/src/stats.rs
, andcrates/node_binding/src/js_values/stats.rs
.Walkthrough
🤖 Generated by Copilot at 72d58f6
Compilation
struct to use getter and setter methods for theassets
field, instead of direct field access, to improve encapsulation and avoid direct mutation of the assets (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)assets
to theJsStats
struct incrates/node_binding/src/js_values/stats.rs
, which stores the names of the assets associated with each module or chunk, if themoduleAssets
option is enabled (link,link,link,link)asset_filenames
to theModule
struct incrates/rspack_core/src/module.rs
, which stores the names of the assets associated with the module (link)asset_filenames
to theLoaderResult
andLoaderContext
structs incrates/rspack_loader_runner/src/runner.rs
, which stores the names of the assets emitted by the loader (link,link,link,link)asset_filenames
to theJsLoaderResult
struct incrates/rspack_binding_options/src/options/raw_module/js_loader.rs
, which stores the names of the assets emitted by the loader (link,link)asset_filenames
field of theModule
struct from theLoaderResult
struct incrates/rspack_core/src/normal_module.rs
(link)module_assets
to theget_modules
andget_chunks
methods of theStats
struct incrates/rspack_core/src/stats.rs
, which indicates whether to include the assets associated with each module or chunk in the output (link,link,link,link)assets
to theStatsModule
andStatsChunk
structs incrates/rspack_core/src/stats.rs
, which stores the names of the assets associated with the module or chunk, if themoduleAssets
option is enabled (link,link)assets
field of theStatsModule
struct from theModule
struct incrates/rspack_core/src/stats.rs
(link,link)#[derive(Debug, Clone)]
attribute to theCssMinifyOptions
struct incrates/rspack_plugin_css/src/lib.rs
, which enables the implementation of theDebug
andClone
traits for the struct (link)SwcCssSourceMapGenConfig
andJsMinifyOptions
structs with variables that are initialized once and cloned for each file, incrates/rspack_plugin_css/src/plugin.rs
andcrates/rspack_plugin_javascript/src/plugin.rs
, to avoid repeating the same code and improve readability and performance (link,link)context
that stores the value of thecompilation.options.context
field, incrates/rspack_plugin_devtool/src/lib.rs
, to avoid repeating the field access multiple times and improve readability and performance (link)