Skip to main content

rspack_plugin_devtool/
lib.rs

1mod eval_dev_tool_module_plugin;
2mod eval_source_map_dev_tool_plugin;
3mod generate_debug_id;
4mod mapped_assets_cache;
5mod module_filename_helpers;
6mod source_map_dev_tool_module_options_plugin;
7mod source_map_dev_tool_plugin;
8
9use std::sync::Arc;
10
11pub use eval_dev_tool_module_plugin::*;
12pub use eval_source_map_dev_tool_plugin::*;
13use futures::future::BoxFuture;
14use rspack_core::ModuleIdentifier;
15use rspack_error::Result;
16pub use source_map_dev_tool_module_options_plugin::*;
17pub use source_map_dev_tool_plugin::*;
18
19pub type ModuleFilenameTemplateFn =
20  Arc<dyn Fn(ModuleFilenameTemplateFnCtx) -> BoxFuture<'static, Result<String>> + Sync + Send>;
21
22pub struct ModuleFilenameTemplateFnCtx {
23  pub identifier: String,
24  pub short_identifier: String,
25  pub resource: String,
26  pub resource_path: String,
27  pub absolute_resource_path: String,
28  pub relative_resource_path: Option<String>,
29  pub loaders: String,
30  pub all_loaders: String,
31  pub query: String,
32  pub module_id: String,
33  pub hash: String,
34  pub namespace: String,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq, Hash)]
38enum SourceReference {
39  Source(Arc<str>),
40  Module(ModuleIdentifier),
41}