buildPreload function

Builder buildPreload([
  1. BuilderOptions? options
])

Implementation

Builder buildPreload([BuilderOptions? options]) {
  options ??= const BuilderOptions({});

  List<Glob>? excludes;
  if (options.config.containsKey('exclude')) {
    excludes = (options.config['exclude'] as List)
        .cast<String>()
        .map((v) => Glob(v))
        .toList();
  }

  List<Glob>? includes;
  if (options.config.containsKey('include')) {
    includes = (options.config['include'] as List)
        .cast<String>()
        .map((v) => Glob(v))
        .toList();
  }

  bool? debug;
  if (options.config.containsKey('debug')) {
    debug = options.config['debug'] as bool;
  }

  return PreloadBuilder(
    excludeGlobs: excludes,
    includeGlobs: includes,
    debug: debug,
  );
}