-
-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compilation): add pluginImport and executeModule
- Loading branch information
Showing
9 changed files
with
496 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
crates/rspack_core/src/dependency/loader_import_dependency.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use crate::{ | ||
AsContextDependency, AsDependencyTemplate, Dependency, DependencyId, ModuleDependency, | ||
}; | ||
|
||
#[derive(Debug, Hash, PartialEq, Eq, Clone)] | ||
pub struct LoaderImportDependency { | ||
request: String, | ||
id: DependencyId, | ||
} | ||
|
||
impl LoaderImportDependency { | ||
pub fn new(request: String) -> Self { | ||
Self { | ||
request, | ||
id: DependencyId::new(), | ||
} | ||
} | ||
} | ||
|
||
impl AsDependencyTemplate for LoaderImportDependency {} | ||
impl AsContextDependency for LoaderImportDependency {} | ||
|
||
impl Dependency for LoaderImportDependency { | ||
fn dependency_debug_name(&self) -> &'static str { | ||
"LoaderImportDependency" | ||
} | ||
|
||
fn id(&self) -> &crate::DependencyId { | ||
&self.id | ||
} | ||
} | ||
|
||
impl ModuleDependency for LoaderImportDependency { | ||
fn request(&self) -> &str { | ||
&self.request | ||
} | ||
|
||
fn user_request(&self) -> &str { | ||
&self.request | ||
} | ||
|
||
fn set_request(&mut self, request: String) { | ||
self.request = request | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters