Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xusd320 committed Mar 6, 2024
1 parent ec0d6e1 commit cd204f9
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions crates/mako/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,26 @@ __mako_require__.loadScript('{}', (e) => e.type === 'load' ? resolve() : reject(

fn create_ignored_module(path: &str, context: Arc<Context>) -> Module {
let module_id = ModuleId::new(path.to_owned());

let mut module = Module::new(module_id, false, None);
let file = File::with_content(
path.to_owned(),
Content::Js("".to_string()),
context.clone(),
);

let ast = Parse::parse(&file, context.clone()).unwrap();
let info = ModuleInfo {
file,
ast,
..Default::default()
let info = {
let file = File::with_content(
path.to_owned(),
Content::Js("".to_string()),
context.clone(),
);
let ast = Parse::parse(&file, context.clone()).unwrap();

ModuleInfo {
file,
ast,
..Default::default()
}
};

module.add_info(Some(info));

module
}

Expand Down

0 comments on commit cd204f9

Please sign in to comment.