-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: only split runtime module into runtime chunk in rust test (#117)
- Loading branch information
Showing
4 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
use std::path::PathBuf; | ||
|
||
use rolldown::{Bundler, InputOptions}; | ||
use rolldown::{Bundler, InputItem, InputOptions}; | ||
use sugar_path::SugarPathBuf; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let root = PathBuf::from(&std::env::var("CARGO_MANIFEST_DIR").unwrap()); | ||
let cwd = root.join("./examples").into_normalize(); | ||
let mut bundler = Bundler::new(InputOptions { | ||
input: Some(vec!["./index.js".to_string().into()]), | ||
input: Some(vec![InputItem { | ||
name: Some("basic".to_string()), | ||
import: "./index.js".to_string(), | ||
}]), | ||
cwd: Some(cwd), | ||
}); | ||
|
||
bundler.generate(Default::default()).await.unwrap(); | ||
let outputs = bundler.write(Default::default()).await.unwrap(); | ||
println!("{outputs:#?}"); | ||
} |
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