with-object.d.ts 724 B

123456789101112131415161718192021222324
  1. import type * as esbuild from "esbuild";
  2. import type { ModuleInfo } from "./module-info";
  3. /**
  4. * Create a `Plugin` for replacing modules with corresponding global variables.
  5. *
  6. * @param globals Object that maps between the two below:
  7. *
  8. * - From: Module path used in any `import` statements that should be replaced
  9. * with a global variable.
  10. * - To: String for a global variable name, or any `ModuleInfo` object
  11. * which also includes the global variable name.
  12. *
  13. * @example
  14. *
  15. * ```
  16. * const plugins = [globalExternals({ jquery: "$" })];
  17. * ```
  18. */
  19. export declare const globalExternals: <T extends string>(
  20. globals: Record<T, string | ModuleInfo>
  21. ) => esbuild.Plugin;
  22. //# sourceMappingURL=with-object.d.ts.map