Skip to content

Commit

Permalink
perf: init
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Dec 10, 2024
1 parent fd8467b commit d83ecb8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
64 changes: 62 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ rayon = { version = "1.10.0" }
regex = { version = "1.11.1" }
ropey = "1.6.1"
rspack_resolver = { version = "0.3.5", features = ["package_json_raw_json_api"] }
rspack_sources = { version = "=0.3.6" }
rspack_sources = { git = "https://github.com/web-infra-dev/rspack-sources", rev = "e11d0250200dfb7e65448b530e97a408e0f6d7ae" }
rustc-hash = { version = "2.1.0" }
serde = { version = "1.0.215" }
serde_json = { version = "1.0.133" }
Expand Down
5 changes: 4 additions & 1 deletion crates/rspack_binding_values/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::cell::RefCell;
use napi_derive::napi;
use rspack_collections::Identifier;
use rspack_core::{
rspack_sources::{RawSource, Source},
rspack_sources::{RawBufferSource, RawSource, Source},
EntrypointsStatsOption, ExtendedStatsOptions, Stats, StatsChunk, StatsModule, StatsUsedExports,
};
use rspack_napi::{
Expand Down Expand Up @@ -503,6 +503,9 @@ impl TryFrom<StatsModule<'_>> for JsStatsModule {

fn try_from(stats: StatsModule) -> std::result::Result<Self, Self::Error> {
let source = stats.source.map(|source| {
if let Some(raw_source) = source.as_any().downcast_ref::<RawBufferSource>() {
return JsStatsModuleSource::B(Buffer::from(raw_source.buffer().to_vec()));
}
if let Some(raw_source) = source.as_any().downcast_ref::<RawSource>() {
if raw_source.is_buffer() {
return JsStatsModuleSource::B(Buffer::from(raw_source.buffer().to_vec()));
Expand Down

0 comments on commit d83ecb8

Please sign in to comment.