index.d.ts 1.3 KB

1234567891011121314151617181920212223242526
  1. import type { BuildConditionals } from '@stencil/core/internal';
  2. /**
  3. * A collection of default build flags for a Stencil project.
  4. *
  5. * This collection can be found throughout the Stencil codebase, often imported from the `@app-data` module like so:
  6. * ```ts
  7. * import { BUILD } from '@app-data';
  8. * ```
  9. * and is used to determine if a portion of the output of a Stencil _project_'s compilation step can be eliminated.
  10. *
  11. * e.g. When `BUILD.allRenderFn` evaluates to `false`, the compiler will eliminate conditional statements like:
  12. * ```ts
  13. * if (BUILD.allRenderFn) {
  14. * // some code that will be eliminated if BUILD.allRenderFn is false
  15. * }
  16. * ```
  17. *
  18. * `@app-data`, the module that `BUILD` is imported from, is an alias for the `@stencil/core/internal/app-data`, and is
  19. * partially referenced by {@link STENCIL_APP_DATA_ID}. The `src/compiler/bundle/app-data-plugin.ts` references
  20. * `STENCIL_APP_DATA_ID` uses it to replace these defaults with {@link BuildConditionals} that are derived from a
  21. * Stencil project's contents (i.e. metadata from the components). This replacement happens at a Stencil project's
  22. * compile time. Such code can be found at `src/compiler/app-core/app-data.ts`.
  23. */
  24. export declare const BUILD: BuildConditionals;
  25. export declare const Env: {};
  26. export declare const NAMESPACE: string;