Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: module info system
Browse files Browse the repository at this point in the history
Jinbao1001 committed Dec 5, 2024
1 parent 9c51b22 commit baf20e4
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/mako/src/build.rs
Original file line number Diff line number Diff line change
@@ -235,6 +235,7 @@ __mako_require__.loadScript('{}', (e) => e.type === 'load' ? resolve() : reject(

ModuleInfo {
file,
module_system: get_module_system(&ast),

Check warning on line 238 in crates/mako/src/build.rs

Codecov / codecov/patch

crates/mako/src/build.rs#L238

Added line #L238 was not covered by tests
ast,
is_ignored: true,
..Default::default()
Original file line number Diff line number Diff line change
@@ -189,6 +189,7 @@ mod tests {
use super::TreeShakeModule;
use crate::ast::file::{Content, File, JsContent};
use crate::ast::js_ast::JsAst;
use crate::ast::utils::get_module_system;
use crate::compiler::Context;
use crate::module::{Module, ModuleAst, ModuleInfo};
use crate::plugins::tree_shaking::shake::skip_module::ReExportSource;
@@ -465,13 +466,13 @@ mod tests {
}),
context.clone(),
);
let ast = JsAst::new(&file, context.clone()).unwrap();

let ast = ModuleAst::Script(JsAst::new(&file, context.clone()).unwrap());
let mako_module = Module {
id: "test.js".into(),
is_entry: false,
info: Some(ModuleInfo {
ast: ModuleAst::Script(ast),
module_system: get_module_system(&ast),
ast,
file,
..Default::default()
}),

0 comments on commit baf20e4

Please sign in to comment.