rolldown 1.0.3

Fast JavaScript bundler in Rust, designed for the future of Vite
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use rolldown_common::{NormalizedBundlerOptions, OutputFormat};
use rolldown_error::{BuildDiagnostic, BuildResult, InvalidOptionType};

pub fn validate_options_for_multi_chunk_output(
  options: &NormalizedBundlerOptions,
) -> BuildResult<()> {
  if matches!(options.format, OutputFormat::Umd | OutputFormat::Iife) {
    Err(BuildDiagnostic::invalid_option(InvalidOptionType::UnsupportedCodeSplittingFormat(
      options.format.to_string(),
    )))?;
  }
  if options.file.is_some() {
    Err(BuildDiagnostic::invalid_option(InvalidOptionType::InvalidOutputFile))?;
  }
  Ok(())
}