版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
1.4 KiB

  1. export { b as builtinPresets, e as createUnimport, a as resolveBuiltinPresets, r as resolvePreset, c as scanDirExports, d as scanExports, s as scanFilesFromDir } from './shared/unimport.7daee659.mjs';
  2. export { l as addImportToCode, b as dedupeImports, d as defineUnimportPreset, e as excludeRE, k as getMagicString, j as getString, i as importAsRE, m as matchRE, n as normalizeImports, r as resolveIdAbsolute, s as separatorRE, a as stripCommentsAndStrings, c as toExports, t as toImports, g as toTypeDeclarationFile, f as toTypeDeclarationItems, h as toTypeReExports } from './shared/unimport.5c780d40.mjs';
  3. import 'mlly';
  4. import 'fs';
  5. import 'local-pkg';
  6. import 'os';
  7. import 'pkg-types';
  8. import 'pathe';
  9. import 'fs/promises';
  10. import 'fast-glob';
  11. import 'scule';
  12. import 'magic-string';
  13. import 'strip-literal';
  14. async function installGlobalAutoImports(imports, options = {}) {
  15. const {
  16. globalObject = globalThis,
  17. overrides = false
  18. } = options;
  19. imports = Array.isArray(imports) ? imports : await imports.getImports();
  20. await Promise.all(
  21. imports.map(async (i) => {
  22. if (i.disabled || i.type) {
  23. return;
  24. }
  25. const as = i.as || i.name;
  26. if (overrides || !(as in globalObject)) {
  27. const module = await import(i.from);
  28. globalObject[as] = module[i.name];
  29. }
  30. })
  31. );
  32. return globalObject;
  33. }
  34. export { installGlobalAutoImports };