Skip to content

Commit a3b9472

Browse files
authored
chore: cleanup for avoiding conflicts with more-js-api-v2 (#9499)
1 parent c0a82b3 commit a3b9472

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
uses: ./.github/actions/pnpm-cache
221221
with:
222222
run-install: false
223-
223+
224224
- name: Run Cargo Check
225225
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow.
226226

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rspack_loader_runner/src/loader.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use regex::Regex;
1414
use rspack_cacheable::cacheable_dyn;
1515
use rspack_collections::{Identifiable, Identifier};
1616
use rspack_error::Result;
17-
use rspack_paths::Utf8PathBuf;
17+
use rspack_paths::{Utf8Path, Utf8PathBuf};
1818
use rspack_util::identifier::strip_zero_width_space_for_fragment;
1919

2020
use super::LoaderContext;
@@ -62,6 +62,21 @@ impl<C> LoaderItem<C> {
6262
self.request
6363
}
6464

65+
#[inline]
66+
pub fn path(&self) -> &Utf8Path {
67+
&self.path
68+
}
69+
70+
#[inline]
71+
pub fn query(&self) -> Option<&str> {
72+
self.query.as_deref()
73+
}
74+
75+
#[inline]
76+
pub fn fragment(&self) -> Option<&str> {
77+
self.fragment.as_deref()
78+
}
79+
6580
#[inline]
6681
pub fn r#type(&self) -> &str {
6782
&self.r#type

crates/rspack_plugin_copy/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dashmap = { workspace = true }
1010
derive_more = { workspace = true, features = ["debug"] }
1111
futures = { workspace = true }
1212
glob = { workspace = true }
13-
lazy_static = "1.5.0"
1413
pathdiff = { workspace = true, features = ["camino"] }
1514
regex = { workspace = true }
1615
rspack_core = { workspace = true }

crates/rspack_plugin_copy/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
hash::Hash,
77
ops::DerefMut,
88
path::{Path, PathBuf, MAIN_SEPARATOR},
9-
sync::{Arc, Mutex},
9+
sync::{Arc, LazyLock, Mutex},
1010
};
1111

1212
use dashmap::DashSet;
@@ -131,10 +131,8 @@ pub struct CopyRspackPlugin {
131131
pub patterns: Vec<CopyPattern>,
132132
}
133133

134-
lazy_static::lazy_static! {
135-
/// This is an example for using doc comment attributes
136-
static ref TEMPLATE_RE: Regex = Regex::new(r"\[\\*([\w:]+)\\*\]").expect("This never fail");
137-
}
134+
static TEMPLATE_RE: LazyLock<Regex> =
135+
LazyLock::new(|| Regex::new(r"\[\\*([\w:]+)\\*\]").expect("This never fail"));
138136

139137
impl CopyRspackPlugin {
140138
pub fn new(patterns: Vec<CopyPattern>) -> Self {

0 commit comments

Comments
 (0)