use std::collections::HashMap;
use std::path::Path;
use super::{build_inner, normalize_path, ModuleGraph, ParsedSourceRetention};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(super) enum PackageContext {
#[default]
Project,
Standalone,
}
pub fn build_with_standalone_source(file: &Path, source: &str) -> ModuleGraph {
let file = normalize_path(file);
let source_overrides = HashMap::from([(file.clone(), source.to_string())]);
build_inner(
&[file],
ParsedSourceRetention::None,
Some(&source_overrides),
PackageContext::Standalone,
)
.graph
}