swc_bundler/hook.rs
1use anyhow::Error;
2use swc_common::{FileName, Span};
3use swc_ecma_ast::KeyValueProp;
4
5#[non_exhaustive]
6pub struct ModuleRecord {
7 pub file_name: FileName,
8 pub is_entry: bool,
9}
10
11pub trait Hook: swc_common::sync::Sync + swc_common::sync::Send {
12 fn get_import_meta_props(
13 &self,
14 span: Span,
15 module_record: &ModuleRecord,
16 ) -> Result<Vec<KeyValueProp>, Error>;
17}