@staticbolt/core 1.0.0-beta.3 → 1.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,8 @@
1
1
  import postcss from "postcss";
2
- import { Config } from "svgo";
3
2
  import * as babel from "@babel/core";
4
3
  import { Pluggable } from "unified";
5
4
  import { Plugin } from "@staticbolt/core";
6
-
5
+ import { Config } from "svgo";
7
6
  //#region src/plugins/analyze-output/analyze-output-plugin.d.ts
8
7
  interface AnalyzeOutputOptions {
9
8
  /**
@@ -31,18 +30,27 @@ interface AnalyzeOutputOptions {
31
30
  */
32
31
  maxFileSize?: Record<string, number> | false;
33
32
  }
33
+ /**
34
+ * Analyzes the production build output and reports three things:
35
+ *
36
+ * - Missing: files the HTML pages reference but that are not in the output directory (errors).
37
+ * - Unused: files in the output directory no page reaches (warnings, deleted when "deleteUnused" is set).
38
+ * - Oversized: files above the per-extension limit in "maxFileSize" (warnings, largest first).
39
+ *
40
+ * Notes:
41
+ *
42
+ * - Runs after the build and only in production.
43
+ * - Reachability is walked from HTML pages only, so anything reachable through another entry point counts as unused.
44
+ * - HTML files are never listed as unused or deleted.
45
+ * - Empty directories under the output are removed on every run, not just when deleting unused files.
46
+ * - "exclude" is matched against paths relative to the output directory and applies to both the unused and the size report.
47
+ */
34
48
  declare function analyzeOutputPlugin(options?: AnalyzeOutputOptions): Plugin;
35
49
  //#endregion
36
50
  //#region src/plugins/bundle-packages/bundle-packages-plugin.d.ts
37
51
  interface BundlePackagesOptions {
38
52
  /** Output directory for bundled `node_modules` packages, relative to the build output directory. */
39
53
  packagesDir?: string;
40
- /**
41
- * Whether to use Terser for minification to reduce the final bundle size.
42
- *
43
- * @default false
44
- */
45
- minifyUsingTerser?: boolean;
46
54
  /**
47
55
  * Bundles specific packages into a single chunk for optimized loading.
48
56
  *
@@ -80,8 +88,22 @@ interface BundlePackagesOptions {
80
88
  }>>;
81
89
  }
82
90
  /**
83
- * Bundles each `node_modules` package and its dependencies into separate files under `packagesDir`. The plugin scans files for
84
- * imports and uses esbuild's tree-shaking capabilities to generate the bundles.
91
+ * Bundles every "node_modules" package imported anywhere in the project into its own file under "packagesDir" and rewrites the
92
+ * imports to point at it. Specifiers are collected across the whole codebase first, so esbuild can tree-shake each package down
93
+ * to what is actually used.
94
+ *
95
+ * Notes:
96
+ *
97
+ * - Runs in both modes; minification and tree-shaking are production-only.
98
+ * - Bare imports in scripts and "<script src>" tags resolving into "node_modules" are both redirected; a script tag is counted as a
99
+ * side-effect import.
100
+ * - A "<link rel=stylesheet>" shipped by a package is moved next to the package output, keeping its path inside the package. Other
101
+ * file types stay where they resolve, under "node_modules".
102
+ * - Dots in the output path become underscores ("highlight.js" becomes "highlight_js"), so a package cannot collide with the file
103
+ * bundled from it.
104
+ * - "chunks" merges packages into one file and renames their default imports to "default_<package>" so they share a module scope,
105
+ * which is what CommonJS packages need to work in the browser.
106
+ * - A package first discovered while bundling another one is bundled right away, then re-bundled once its specifiers are known.
85
107
  */
86
108
  declare function bundlePackagesPlugin(options?: BundlePackagesOptions): Plugin;
87
109
  //#endregion
@@ -120,6 +142,22 @@ interface ConvertImageOptions {
120
142
  */
121
143
  exclude?: string[];
122
144
  }
145
+ /**
146
+ * Converts the images matched by "include" to a single target format with sharp, and rewrites every reference to them.
147
+ *
148
+ * References are updated wherever the sources pipeline sees them (HTML attributes, styles, scripts, web manifest); an "image/*"
149
+ * type on the tag or manifest entry is rewritten too. In scripts, "_img.<ext>" expressions are replaced with the format string,
150
+ * so the same code resolves to the original extension in development and to the converted one in production.
151
+ *
152
+ * Quality and preset can be overridden per file through the filename: "hero-q:75-p:picture.jpg".
153
+ *
154
+ * Notes:
155
+ *
156
+ * - Conversion happens after the build and only in production; development keeps serving the originals untouched.
157
+ * - The output mirrors the source path relative to the project root, with only the extension replaced.
158
+ * - Converted sources are published on "pluginData.convertedImages" so copy-assets does not copy the originals over them.
159
+ * - "preset" is a WebP-only option and is ignored by the other formats.
160
+ */
123
161
  declare function convertImagePlugin(options?: ConvertImageOptions): Plugin;
124
162
  //#endregion
125
163
  //#region src/plugins/copy-assets/copy-assets-plugin.d.ts
@@ -143,6 +181,19 @@ interface CopyAssetsOptions {
143
181
  */
144
182
  publicDirectory?: string;
145
183
  }
184
+ /**
185
+ * Copies asset files into the output directory at the end of a production build.
186
+ *
187
+ * Two passes: files matching "include" keep their path relative to the project root, while everything under "publicDirectory" is
188
+ * copied to the output root with that prefix dropped (e.g. "public/favicon.ico" becomes "<outdir>/favicon.ico").
189
+ *
190
+ * Notes:
191
+ *
192
+ * - Runs after the build and only in production.
193
+ * - Existing output files are never overwritten, and assets other plugins already emitted (converted images, optimized SVGs) are
194
+ * skipped so the originals cannot replace them.
195
+ * - "exclude" applies to both passes; the public pass also copies dotfiles.
196
+ */
146
197
  declare function copyAssetsPlugin(options?: CopyAssetsOptions): Plugin;
147
198
  //#endregion
148
199
  //#region src/plugins/custom-ease/easing-functions/types.d.ts
@@ -264,6 +315,22 @@ interface CustomEasePluginOptions {
264
315
  */
265
316
  samples?: number;
266
317
  }
318
+ /**
319
+ * Replaces named easing calls with plain CSS values at build time, so there is nothing to resolve at runtime. Simple curves
320
+ * become a "cubic-bezier()" string, computed ones (springs, bounces, elastics) are sampled into a "linear()" function.
321
+ *
322
+ * Three places, each with its own switch: CSS declarations (on by default, "--ease-*()" calls), JavaScript
323
+ * ("cssLinear.outCubic()", opt-in) and inline HTML "style" attributes (opt-in).
324
+ *
325
+ * Notes:
326
+ *
327
+ * - Runs in development and production alike.
328
+ * - JS call names are camelCase and matched kebab-cased, so "cssLinear.outCubic()" resolves the "out-cubic" definition.
329
+ * - Anything that does not resolve is left exactly as written: unknown names, unbalanced parentheses, or arguments that are not
330
+ * plain numbers (in JS they must be numeric literals).
331
+ * - "customEase" entries are merged over the predefined set, so reusing a name overrides it.
332
+ * - "samples" trades output size for accuracy; it only affects easings that end up as "linear()".
333
+ */
267
334
  declare function customEasePlugin(options?: CustomEasePluginOptions): Plugin;
268
335
  //#endregion
269
336
  //#region src/plugins/i18n/i18n-plugin.d.ts
@@ -305,6 +372,18 @@ interface I18nPluginOptions {
305
372
  */
306
373
  placeholderPrefix?: string;
307
374
  }
375
+ /**
376
+ * Adds internationalization: every page is emitted once per locale with its translation markers resolved, and scripts get a set
377
+ * of compile-time helpers. Returns the three plugins that do the work (HTML, scripts, CLI) sharing the same resolved options.
378
+ *
379
+ * Translations live in one JSON file per locale inside "localesDirectory" ("en.json", "ar.json", ...). Nested objects turn into
380
+ * dot-notated keys, and values can carry "{{ name=fallback }}" placeholders.
381
+ *
382
+ * Notes:
383
+ *
384
+ * - The default locale is emitted at the original paths; the others go under a directory named after the locale.
385
+ * - Locale files are read once and cached for the whole process, so a running dev server does not pick up edits to them.
386
+ */
308
387
  declare function i18nPlugin(options?: I18nPluginOptions): Plugin[];
309
388
  //#endregion
310
389
  //#region src/plugins/import-as-string/types.d.ts
@@ -334,6 +413,23 @@ interface ImportAsStringOptions {
334
413
  type import_as_string = (filePath: string, options?: ImportAsStringOptions) => string;
335
414
  //#endregion
336
415
  //#region src/plugins/import-as-string/import-as-string-plugin.d.ts
416
+ /**
417
+ * Replaces "import_as_string(path, options?)" calls in scripts with the contents of that file, inlined as a string literal at
418
+ * build time.
419
+ *
420
+ * By default the file is taken from the build, so what lands in the string is the processed version, and "minify" and "format"
421
+ * control how it is printed. With "process: false" the file is read straight from disk instead, untouched, and with
422
+ * "templateLiteral: true" the value is inlined as a template literal rather than a quoted string.
423
+ *
424
+ * Notes:
425
+ *
426
+ * - The path and the options object have to be statically resolvable; anything dynamic is reported and the call is left in the
427
+ * code, where it will fail at runtime.
428
+ * - The path is resolved relative to the file doing the importing.
429
+ * - "minify" and "format" only apply in production; in development the file is inlined as it is.
430
+ * - An inlined file is dropped from the output unless it is an entry point in its own right.
431
+ * - Editing an inlined file recompiles the scripts that inline it.
432
+ */
337
433
  declare function importAsStringPlugin(): Plugin;
338
434
  //#endregion
339
435
  //#region src/plugins/load-sources/load-sources-plugin.d.ts
@@ -341,6 +437,16 @@ interface LoadSourcesPluginOptions {
341
437
  include: string[];
342
438
  exclude?: string[];
343
439
  }
440
+ /**
441
+ * Registers the files matched by "include" as entry points: the roots the build starts from, with everything they reference
442
+ * discovered, transformed and emitted along with them.
443
+ *
444
+ * Notes:
445
+ *
446
+ * - Patterns are matched from the project root at startup, and matching nothing is reported as an error.
447
+ * - Matched files are watched, so creating or deleting one updates the entry point set without a restart.
448
+ * - Any file type staticbolt can load works as an entry point, HTML, markdown, scripts and styles alike.
449
+ */
344
450
  declare function loadSourcesPlugin(options: LoadSourcesPluginOptions): Plugin;
345
451
  //#endregion
346
452
  //#region src/plugins/robots-text/robots-text-plugin.d.ts
@@ -364,6 +470,16 @@ interface RobotsTextOptions {
364
470
  /** The path to the sitemap file. */
365
471
  sitemapUrl?: string;
366
472
  }
473
+ /**
474
+ * Writes a "robots.txt" into the output directory from the rules given in the options.
475
+ *
476
+ * Notes:
477
+ *
478
+ * - Production only, and only when at least one rule is configured; with an empty "rules" list nothing is written.
479
+ * - Every rule becomes a "User-agent" block followed by its "Allow" and "Disallow" lines, in the order they are listed.
480
+ * - "sitemapUrl" appends a "Sitemap:" line as given, so pass the full URL.
481
+ * - The file is written straight to disk after the build and is not part of the build graph.
482
+ */
367
483
  declare function robotsTextPlugin(options?: RobotsTextOptions): Plugin;
368
484
  //#endregion
369
485
  //#region src/plugins/service-worker/service-worker-plugin.d.ts
@@ -371,13 +487,13 @@ interface ServiceWorkerOptions {
371
487
  /**
372
488
  * Glob patterns for matching files.
373
489
  *
374
- * @default ["**\/*"]
490
+ * @default ["**\/*.{js,wasm,css,html}"]
375
491
  */
376
492
  globPatterns?: string[];
377
493
  /**
378
494
  * Glob patterns for files to ignore.
379
495
  *
380
- * @default ["**\/node_modules/**\/*"]
496
+ * @default ["**\/node_modules\/**\/*"]
381
497
  */
382
498
  globIgnores?: string[];
383
499
  /**
@@ -407,13 +523,13 @@ interface ServiceWorkerOptions {
407
523
  /**
408
524
  * Whether to skip waiting and immediately activate the service worker.
409
525
  *
410
- * @default true
526
+ * @default false
411
527
  */
412
528
  skipWaiting?: boolean;
413
529
  /**
414
530
  * Whether the service worker should claim all available clients.
415
531
  *
416
- * @default true
532
+ * @default false
417
533
  */
418
534
  clientsClaim?: boolean;
419
535
  /**
@@ -425,7 +541,7 @@ interface ServiceWorkerOptions {
425
541
  /**
426
542
  * Cleans up outdated caches during service worker activation.
427
543
  *
428
- * @default true
544
+ * @default false
429
545
  */
430
546
  cleanupOutdatedCaches?: boolean;
431
547
  /**
@@ -448,7 +564,12 @@ interface ServiceWorkerOptions {
448
564
  modifyURLPrefix?: Record<string, string>;
449
565
  }
450
566
  /**
451
- * Please don't forget to register the service worker in your HTML file.
567
+ * Generates a Workbox service worker from the finished output directory, precaching every file that matches "globPatterns".
568
+ *
569
+ * The options are handed to workbox-build's "generateSW", with "swDest" resolved inside the output directory and the project's
570
+ * browserslist used as the Babel target.
571
+ *
572
+ * Registering it is up to the page:
452
573
  *
453
574
  * ```ts
454
575
  * import { Workbox } from "workbox-window";
@@ -458,6 +579,13 @@ interface ServiceWorkerOptions {
458
579
  * wb.register();
459
580
  * }
460
581
  * ```
582
+ *
583
+ * Notes:
584
+ *
585
+ * - Production only, and it runs after the build, so it sees the final files, copied assets included.
586
+ * - The precache manifest is built from the output directory; files larger than "maximumFileSizeToCacheInBytes" (2 MB by default)
587
+ * are left out.
588
+ * - The worker is written straight to disk and is not part of the build graph.
461
589
  */
462
590
  declare function serviceWorkerPlugin(options?: ServiceWorkerOptions): Plugin;
463
591
  //#endregion
@@ -488,6 +616,18 @@ interface SitemapOptions {
488
616
  */
489
617
  exclude?: string[];
490
618
  }
619
+ /**
620
+ * Writes a "sitemap.xml" listing the HTML pages that ended up in the output directory.
621
+ *
622
+ * Notes:
623
+ *
624
+ * - Production only, and only when "sitemapUrl" is set; without it nothing is generated.
625
+ * - The pages are globbed from the output directory after the build, so the list reflects what was really emitted, and "include"
626
+ * and "exclude" are matched there as well.
627
+ * - Each entry is the URL of the file's directory with a trailing slash: "blog/post/index.html" becomes ".../blog/post/", and a
628
+ * page that is not an "index.html" collapses onto the URL of its parent directory.
629
+ * - Only "<loc>" is emitted, no "lastmod", "changefreq" or "priority".
630
+ */
491
631
  declare function sitemapPlugin(options?: SitemapOptions): Plugin;
492
632
  //#endregion
493
633
  //#region src/plugins/svgo/svgo-plugin.d.ts
@@ -514,11 +654,17 @@ interface svgoOptions {
514
654
  svgoConfig?: Config;
515
655
  }
516
656
  /**
517
- * Optimize SVG files and SVG tags in HTML using `svgo`.
657
+ * Optimizes SVGs with svgo, both the inline "<svg>" tags of a page and the files matched by "include", which are optimized and
658
+ * written to the output directory.
518
659
  *
519
- * For CSS inlined SVGs, use a PostCSS plugin like `cssnano` instead.
660
+ * Notes:
520
661
  *
521
- * **Production Only**
662
+ * - Production only.
663
+ * - Results are cached per SVG string, so an icon repeated across many pages goes through svgo once per build.
664
+ * - Files it wrote are published on "pluginData.optimizedSvgList" so copy-assets does not put the originals over them.
665
+ * - The default config is svgo's "preset-default" with id cleanup, hidden-element removal and unknown-attribute removal turned off,
666
+ * so ids and hooks the rest of the page relies on survive. Passing "svgoConfig" replaces that default entirely.
667
+ * - SVGs inlined in CSS are out of reach; use a PostCSS plugin such as cssnano for those.
522
668
  */
523
669
  declare function svgoPlugin(options?: svgoOptions): Plugin;
524
670
  //#endregion
@@ -533,6 +679,16 @@ interface TransformCssOptions {
533
679
  */
534
680
  loadConfig?: boolean;
535
681
  }
682
+ /**
683
+ * Runs PostCSS plugins over every stylesheet in the build, the "<style>" tags of a page included.
684
+ *
685
+ * Notes:
686
+ *
687
+ * - The plugins given in the options run first, followed by the ones from the PostCSS config file when "loadConfig" is on.
688
+ * - That config is read once at startup, with the build mode and the project's browserslist as its context.
689
+ * - With no plugins at all the pass is skipped.
690
+ * - A plugin error is reported for the stylesheet it happened in and the build carries on.
691
+ */
536
692
  declare function transformCssPlugin(options?: TransformCssOptions): Plugin;
537
693
  //#endregion
538
694
  //#region src/plugins/transform-js/transform-js-plugin.d.ts
@@ -540,6 +696,18 @@ interface TransformJsPluginOptions {
540
696
  presets?: babel.PluginItem[];
541
697
  plugins?: babel.PluginItem[];
542
698
  }
699
+ /**
700
+ * Runs Babel over every script in the build, TypeScript and JSX included.
701
+ *
702
+ * Presets are applied in order: TypeScript (all extensions, JSX enabled), preset-env against the project's browserslist, then the
703
+ * project's own Babel config, then whatever the options add.
704
+ *
705
+ * Notes:
706
+ *
707
+ * - "_production" is substituted with the build mode, so a check like "if (_production)" is resolved at build time.
708
+ * - Module syntax is preserved; ".ts", ".jsx" and ".tsx" files only change their output path to ".js".
709
+ * - The result is resolved and loaded again, so imports a Babel plugin introduces still become part of the build.
710
+ */
543
711
  declare function transformJsPlugin(options?: TransformJsPluginOptions): Plugin;
544
712
  //#endregion
545
713
  //#region src/plugins/web-manifest/web-manifest-plugin.d.ts
@@ -557,6 +725,15 @@ interface WebManifestOptions {
557
725
  */
558
726
  outfile?: string;
559
727
  }
728
+ /**
729
+ * Emits the web app manifest at "outfile" and repoints the links to it.
730
+ *
731
+ * Notes:
732
+ *
733
+ * - Only the file at "manifestPath" counts as the manifest; links to any other JSON are left alone.
734
+ * - It is rebased once the transforms are done, so the paths inside it (icons, screenshots) keep resolving from the new location.
735
+ * - The links are rewritten in production only; while serving, the manifest stays at its source path.
736
+ */
560
737
  declare function webManifestPlugin(options?: WebManifestOptions): Plugin;
561
738
  //#endregion
562
739
  //#region src/plugins/write-files/write-files-plugin.d.ts
@@ -575,6 +752,12 @@ interface WriteFilesOptions {
575
752
  * @default [ ]
576
753
  */
577
754
  exclude?: string[];
755
+ /**
756
+ * How many worker threads may minify or format output files at once.
757
+ *
758
+ * @default One per core, up to eight
759
+ */
760
+ concurrency?: number;
578
761
  minify?: {
579
762
  /**
580
763
  * Whether to minify output.
@@ -616,6 +799,22 @@ interface WriteFilesOptions {
616
799
  exclude?: string[];
617
800
  };
618
801
  }
802
+ /**
803
+ * Emits the build: everything that survived the pipeline is stringified and written under the output directory, with binary
804
+ * assets copied over as they are.
805
+ *
806
+ * Notes:
807
+ *
808
+ * - Production only. The dev server serves from memory and writes nothing.
809
+ * - "clean" removes the output directory before the build starts.
810
+ * - "include" and "exclude" are matched against the source path, and anything a plugin excluded from emitting is skipped.
811
+ * - "minify" and "format" carry their own patterns; turning both on for the same file logs a warning.
812
+ * - A file whose path would land outside the output directory is reported and skipped.
813
+ * - Formatting and minifying are the slow part of printing a file, so any plugin willing to hand its final pass over gets taken up
814
+ * on it: the file is written as it came out and its pass goes to a pool of worker threads chewing through them while the files
815
+ * behind it are still being written. The pool is drained before this hook returns, so the output directory is settled by the
816
+ * time anything else runs.
817
+ */
619
818
  declare function writeFilesPlugin(options: WriteFilesOptions): Plugin;
620
819
  //#endregion
621
820
  //#region src/plugins/html-build-time-script/html-build-time-script.d.ts
@@ -633,8 +832,33 @@ interface HtmlBuildTimeScriptOptions {
633
832
  * @default "full-dom"
634
833
  */
635
834
  fullDomAttribute?: string;
835
+ /**
836
+ * The name of the attribute on the script tag that holds a JSON object, whose entries are exposed as globals to the script
837
+ * during execution.
838
+ *
839
+ * @default "context"
840
+ */
636
841
  contextAttribute?: string;
637
842
  }
843
+ /**
844
+ * Executes script tags marked with "build-time" during the build and keeps whatever they did to the page. The tag itself never
845
+ * reaches the output.
846
+ *
847
+ * Attributes (names configurable via HtmlBuildTimeScriptOptions):
848
+ *
849
+ * - "build-time": execute this tag, inline or through "src".
850
+ * - "full-dom": run against a jsdom document instead of the lighter node-html-parser AST.
851
+ * - "context": a JSON object whose entries become globals for that script.
852
+ *
853
+ * Scripts run in "node:vm" with "document", "window", "StaticBolt" (the app), "__filepath" and "__id" in scope. "context" entries
854
+ * are applied last, so they can shadow those names; if the JSON fails to parse the script still runs without them.
855
+ *
856
+ * Notes:
857
+ *
858
+ * - "full-dom" needs a fully constructed page (a head and a body), so place this plugin last when using it.
859
+ * - Failures are per tag: the error is logged and the rest of the page carries on.
860
+ * - In development the files each page executed are tracked, so editing one of them recompiles the pages that used it.
861
+ */
638
862
  declare function htmlBuildTimeScript(options?: HtmlBuildTimeScriptOptions): Plugin;
639
863
  //#endregion
640
864
  //#region src/plugins/html-bundle-script/html-bundle-script-plugin.d.ts
@@ -664,6 +888,8 @@ interface HtmlBundleScriptOptions {
664
888
  /**
665
889
  * The HTML attribute name that specifies the output file path for the bundled script.
666
890
  *
891
+ * The attribute value is always resolved relative to the output directory, regardless of where the HTML file lives.
892
+ *
667
893
  * @default "bundle-out"
668
894
  */
669
895
  bundleOutAttribute?: string;
@@ -683,24 +909,33 @@ interface HtmlBundleScriptOptions {
683
909
  * @default "bundle-externals-exclude"
684
910
  */
685
911
  externalsExcludeAttribute?: string;
912
+ /**
913
+ * The HTML attribute name that switches the bundle output format from ESM to IIFE.
914
+ *
915
+ * The attribute is a boolean flag; its value is ignored.
916
+ *
917
+ * @default "iife"
918
+ */
919
+ iifeAttribute?: string;
686
920
  }
687
921
  /**
688
- * A plugin that bundles `<script>` tags in HTML files using esbuild.
922
+ * Bundles script tags in HTML files with esbuild. Opt-in per tag.
689
923
  *
690
- * Bundling is opt-in per script tag via the `bundle` attribute (configurable via {@link HtmlBundleScriptOptions.bundleAttribute}).
924
+ * Attributes (names configurable via HtmlBundleScriptOptions):
691
925
  *
692
- * **Inlining vs. separate file**
926
+ * - "bundle": bundle this tag.
927
+ * - "bundle-out": output path, resolved from the output directory, not from the HTML file.
928
+ * - "bundle-externals" / "bundle-externals-exclude": semicolon-separated globs, override the plugin defaults for this tag.
929
+ * - "iife": emit an IIFE instead of ESM.
693
930
  *
694
- * - Inline script, no `bundle-out` attribute —> bundled output replaces the tag's content in place.
695
- * - Inline script, `bundle-out` attribute set —> tag content is cleared and `src` is set to the output file.
696
- * - `src` script, no `bundle-out` attribute —> bundle is written to `{filename}.bundle.js` and `src` is updated to point to it.
697
- * - `src` script, `bundle-out` attribute set —> bundle is written to the specified path and `src` is updated to point to it.
931
+ * Without "bundle-out", an inline script is bundled in place and a "src" script is written to "{filename}.bundle.js" next to the
932
+ * original. With it, "src" is pointed at the output path and inline content is cleared.
698
933
  *
699
- * **Externals resolution**
934
+ * Notes:
700
935
  *
701
- * Glob patterns in {@link HtmlBundleScriptOptions.externals} and {@link HtmlBundleScriptOptions.externalsExclude} are matched
702
- * against each resolved module path. A module is treated as external if it matches `externals` and does not match
703
- * `externalsExclude`.
936
+ * - Bundling only runs in production; in dev the attributes are just stripped. They never reach the output either way.
937
+ * - If the target output path is already bundled, the work is skipped and "src" is simply pointed at it.
938
+ * - "iife" only changes the esbuild format; the tag's "type" is untouched, so remove "type=module" yourself if needed.
704
939
  */
705
940
  declare function htmlBundleScriptPlugin(options?: HtmlBundleScriptOptions): Plugin;
706
941
  //#endregion
@@ -713,8 +948,62 @@ interface HtmlBundleStyleOptions {
713
948
  */
714
949
  bundleAttribute?: string;
715
950
  }
951
+ /**
952
+ * Inlines the "@import" tree of a stylesheet, so the tag ends up self-contained. Opt-in per tag through the "bundle" attribute
953
+ * (configurable via HtmlBundleStyleOptions) on a "<link rel=stylesheet>" or a "<style>" tag.
954
+ *
955
+ * Bundling happens in place: a "<style>" tag gets the resolved CSS as its content, and a linked file is rewritten with its
956
+ * imports inlined while "href" stays as it is.
957
+ *
958
+ * Notes:
959
+ *
960
+ * - Production only. In development nothing runs and the "bundle" attribute is left on the tag.
961
+ * - "<link rel=preload as=style>" is always bundled, with or without the attribute, since a preloaded stylesheet has to carry
962
+ * everything it needs.
963
+ * - A linked stylesheet is bundled once even when several pages link to it; they share the same file.
964
+ * - Imports resolve the way every other source does: relative paths, path aliases and packages, through the build's resolver.
965
+ * - Imported files are pulled from the build (so transforms other plugins made are included) and only read from disk when they are
966
+ * not part of it. They stay in the output as separate files, now unreferenced. Their "url()" references are rebased onto the
967
+ * bundle's location.
968
+ * - Conditions ("layer", "supports()", media) wrap the imported rules, a file imported twice under the same conditions is kept
969
+ * where it was imported last, as in a browser, and imports from other origins are hoisted to the top.
970
+ */
716
971
  declare function htmlBundleStylePlugin(options?: HtmlBundleStyleOptions): Plugin;
717
972
  //#endregion
973
+ //#region src/plugins/html-env-only/html-env-only-plugin.d.ts
974
+ interface HtmlEnvOnlyOptions {
975
+ /**
976
+ * The HTML attribute name that marks a tag as development-only.
977
+ *
978
+ * Tags with this attribute are removed at build time and kept (with the attribute stripped) during dev serve.
979
+ *
980
+ * @default "dev-only"
981
+ */
982
+ devOnlyAttribute?: string;
983
+ /**
984
+ * The HTML attribute name that marks a tag as production-only.
985
+ *
986
+ * Tags with this attribute are removed during dev serve and kept (with the attribute stripped) at build time.
987
+ *
988
+ * @default "production-only"
989
+ */
990
+ productionOnlyAttribute?: string;
991
+ }
992
+ /**
993
+ * Removes the HTML tags that do not belong in the current environment.
994
+ *
995
+ * Attributes (names configurable via HtmlEnvOnlyOptions):
996
+ *
997
+ * - "dev-only": kept while serving, removed from the production build.
998
+ * - "production-only": kept in the production build, removed while serving.
999
+ *
1000
+ * Notes:
1001
+ *
1002
+ * - Works on any element, and removal takes the element's whole subtree with it.
1003
+ * - Where the tag survives, the marker attribute is stripped from the output.
1004
+ */
1005
+ declare function htmlEnvOnlyPlugin(options?: HtmlEnvOnlyOptions): Plugin;
1006
+ //#endregion
718
1007
  //#region src/plugins/html-fragment/html-fragment-plugin.d.ts
719
1008
  interface HtmlFragmentOptions {
720
1009
  /**
@@ -724,6 +1013,16 @@ interface HtmlFragmentOptions {
724
1013
  */
725
1014
  tagName?: string;
726
1015
  }
1016
+ /**
1017
+ * Replaces every "<fragment>" element (tag name configurable via HtmlFragmentOptions) with its own content, so the wrapper leaves
1018
+ * no trace in the output. Handy for grouping markup a layout or an insert has to treat as one node.
1019
+ *
1020
+ * Notes:
1021
+ *
1022
+ * - Runs in development and production alike.
1023
+ * - The content is re-parsed from the element's inner HTML and trimmed, so surrounding whitespace is dropped.
1024
+ * - Fragments nest: the page is rescanned after each replacement, so a fragment inside another one is unwrapped as well.
1025
+ */
727
1026
  declare function htmlFragmentPlugin(options?: HtmlFragmentOptions): Plugin;
728
1027
  //#endregion
729
1028
  //#region src/plugins/html-iife-script/html-iife-script-plugin.d.ts
@@ -735,6 +1034,16 @@ interface HtmlIifeScriptOptions {
735
1034
  */
736
1035
  iifeAttribute?: string;
737
1036
  }
1037
+ /**
1038
+ * Wraps the body of a script tag marked with "iife" (attribute configurable via HtmlIifeScriptOptions) in an immediately invoked
1039
+ * function expression, so its declarations stay out of the global scope.
1040
+ *
1041
+ * Notes:
1042
+ *
1043
+ * - The attribute is stripped in both modes, but the wrapping only happens in production.
1044
+ * - Inline scripts only: a tag with a "src" attribute is reported as an error and left alone.
1045
+ * - Meant for classic scripts. A module already has its own scope, so wrapping one buys nothing.
1046
+ */
738
1047
  declare function htmlIifeScriptPlugin(options?: HtmlIifeScriptOptions): Plugin;
739
1048
  //#endregion
740
1049
  //#region src/plugins/html-inline-script/html-inline-script-plugin.d.ts
@@ -746,6 +1055,22 @@ interface HtmlInlineScriptOptions {
746
1055
  */
747
1056
  inlineAttribute?: string;
748
1057
  }
1058
+ /**
1059
+ * Replaces a script tag marked with "inline" (attribute configurable via HtmlInlineScriptOptions) with the code it points at, so
1060
+ * the page ships one request fewer. The "src" attribute is dropped and the code becomes the tag's content.
1061
+ *
1062
+ * The source can be a local file or a remote URL; a URL is downloaded at build time, cached per page directory and URL, and kept
1063
+ * out of the output.
1064
+ *
1065
+ * Notes:
1066
+ *
1067
+ * - The attribute is stripped in both modes, but the inlining only happens in production.
1068
+ * - The tag must have a "src" and no content of its own; anything else is reported as an error and left alone.
1069
+ * - A local file has to be part of the build already, otherwise its metadata is not found and nothing is inlined.
1070
+ * - The inlined copy is rebased onto the HTML file, so its relative imports keep resolving, and the original file stays in the
1071
+ * output unless something removes it.
1072
+ * - The tag's "type" decides whether the inlined code is treated as a module, not the original file.
1073
+ */
749
1074
  declare function htmlInlineScriptPlugin(options?: HtmlInlineScriptOptions): Plugin;
750
1075
  //#endregion
751
1076
  //#region src/plugins/html-inline-style/html-inline-style-plugin.d.ts
@@ -757,6 +1082,21 @@ interface HtmlInlineStyleOptions {
757
1082
  */
758
1083
  inlineAttribute?: string;
759
1084
  }
1085
+ /**
1086
+ * Turns a "<link rel=stylesheet>" marked with "inline" (attribute configurable via HtmlInlineStyleOptions) into a "<style>" tag
1087
+ * holding the stylesheet itself, so the page ships one request fewer.
1088
+ *
1089
+ * The "href" can point at a local file or a remote URL; a URL is downloaded at build time, cached per page directory and URL, and
1090
+ * kept out of the output.
1091
+ *
1092
+ * Notes:
1093
+ *
1094
+ * - The attribute is stripped in both modes, but the inlining only happens in production.
1095
+ * - The link's remaining attributes are copied onto the "<style>" tag; "href" and "rel" are dropped.
1096
+ * - A local file has to be part of the build already, otherwise its metadata is not found and nothing is inlined.
1097
+ * - The inlined copy is rebased onto the HTML file, so relative "url()" and "@import" paths keep resolving, and the original file
1098
+ * stays in the output unless something removes it.
1099
+ */
760
1100
  declare function htmlInlineStylePlugin(options?: HtmlInlineStyleOptions): Plugin;
761
1101
  //#endregion
762
1102
  //#region src/plugins/html-inline-svg/html-inline-svg-plugin.d.ts
@@ -768,6 +1108,21 @@ interface HtmlInlineSvgOptions {
768
1108
  */
769
1109
  inlineAttribute?: string;
770
1110
  }
1111
+ /**
1112
+ * Replaces an "<svg inline src=...>" placeholder (attribute configurable via HtmlInlineSvgOptions) with the actual SVG element
1113
+ * from the file, so it can be styled and scripted like any other markup.
1114
+ *
1115
+ * The "src" can point at a local file or a remote URL; a URL is downloaded at build time, cached per page directory and URL, and
1116
+ * kept out of the output.
1117
+ *
1118
+ * Notes:
1119
+ *
1120
+ * - Runs in development and production alike.
1121
+ * - Every attribute left on the placeholder is copied onto the inlined element and overrides what the file declares, "viewBox" and
1122
+ * "fill" included.
1123
+ * - A local file has to be part of the build already, otherwise its metadata is not found and the placeholder is left as it is.
1124
+ * - Only the "<svg>" element of the file is taken; anything around it in the file is dropped.
1125
+ */
771
1126
  declare function HtmlInlineSvgPlugin(options?: HtmlInlineSvgOptions): Plugin;
772
1127
  //#endregion
773
1128
  //#region src/plugins/html-inline-text/html-inline-text-plugin.d.ts
@@ -791,6 +1146,18 @@ interface HtmlInlineTextOptions {
791
1146
  */
792
1147
  noEscapeAttribute?: string;
793
1148
  }
1149
+ /**
1150
+ * Replaces an "<inline-text src=...>" tag with the contents of the file it points at (tag and attribute names configurable via
1151
+ * HtmlInlineTextOptions). The text is HTML-escaped unless the tag carries "no-escape", which inserts it as markup.
1152
+ *
1153
+ * Notes:
1154
+ *
1155
+ * - Runs in development and production alike.
1156
+ * - The file is read straight from disk, so it is not a build source and no other plugin transforms it.
1157
+ * - Contents are cached per path for the whole build, escaping included: when two tags point at the same file, the first one
1158
+ * decides whether both end up escaped.
1159
+ * - The cache is dropped when the file changes, and pages that inlined it are recompiled, so the dev server stays in sync.
1160
+ */
794
1161
  declare function htmlInlineTextPlugin(options?: HtmlInlineTextOptions): Plugin;
795
1162
  //#endregion
796
1163
  //#region src/plugins/html-insert/html-insert-plugin.d.ts
@@ -820,6 +1187,23 @@ interface HtmlInsertOptions {
820
1187
  */
821
1188
  whereAttribute?: string;
822
1189
  }
1190
+ /**
1191
+ * Moves the content of an "<insert>" tag into any element on the same page, addressed by a CSS selector, then removes the tag
1192
+ * itself (names configurable via HtmlInsertOptions).
1193
+ *
1194
+ * Attributes:
1195
+ *
1196
+ * - "selector": the CSS selector of the target element.
1197
+ * - "where": where the content lands, one of "beforebegin", "afterbegin", "beforeend" (the default) or "afterend".
1198
+ * - "replace": swap the target element for the content instead of inserting into it.
1199
+ *
1200
+ * Notes:
1201
+ *
1202
+ * - Runs in development and production alike, and only searches the page the tag lives on.
1203
+ * - A tag whose target is not on the page yet is left untouched, since layouts and pages are assembled in several passes. Any tag
1204
+ * still unresolved at the end of the build is reported and stays in the output.
1205
+ * - An "<insert>" with no content or no selector is reported and left alone.
1206
+ */
823
1207
  declare function htmlInsertPlugin(options?: HtmlInsertOptions): Plugin;
824
1208
  //#endregion
825
1209
  //#region src/plugins/html-layout/html-layout-plugin.d.ts
@@ -849,7 +1233,7 @@ interface HtmlLayoutOptions {
849
1233
  * attributes and any keys loaded via `dataSource`. Inline attributes take priority over `dataJson` keys; `dataJson` keys take
850
1234
  * priority over `dataSource` keys.
851
1235
  *
852
- * @default "data"
1236
+ * @default "dataJson"
853
1237
  */
854
1238
  dataJsonAttribute?: string;
855
1239
  /**
@@ -886,6 +1270,31 @@ interface HtmlLayoutOptions {
886
1270
  */
887
1271
  removeAttributeAttribute?: string;
888
1272
  }
1273
+ /**
1274
+ * Composes pages out of reusable "<layout>" and "<part>" files (tag names configurable via HtmlLayoutOptions). The tag is
1275
+ * replaced by the file it points at, the tag's children are distributed into the file's "<slot>" elements, and the scripts and
1276
+ * styles the file declares are merged into the page.
1277
+ *
1278
+ * Attributes on the tag:
1279
+ *
1280
+ * - "src": the file to inline. Its name must end with ".<tag>.html", so "<part>" loads "*.part.html".
1281
+ * - "dataSource" and "dataJson": data for the file's placeholders, as a path to a JSON file and as an inline JSON string.
1282
+ * - Anything else on the tag is data as well.
1283
+ *
1284
+ * Inside the file, "{{ expression }}" is evaluated as JavaScript with the data exposed as "$data" (a leading backslash escapes a
1285
+ * placeholder, and an expression returning undefined or an object is an error), while "add-attr-<name>" and "remove-attr-<name>"
1286
+ * toggle a boolean attribute when their value is non-empty and not "false".
1287
+ *
1288
+ * Notes:
1289
+ *
1290
+ * - Data precedence, lowest first: the "dataSource" file, then "dataJson", then the tag's own attributes.
1291
+ * - Layouts nest, and a page is rescanned after each expansion, so a layout can pull in further layouts and parts.
1292
+ * - Markdown pages take their layout from front matter: a "layout" or "part" key names the file, the other keys are data.
1293
+ * - Using the same layout twice on one page emits its scripts, styles and stylesheet links once; "always-include" opts a tag out of
1294
+ * that and gives it one copy per instance.
1295
+ * - Layout files never reach the output on their own, and editing one recompiles every page and layout that pulls it in.
1296
+ * - In production an instance is rendered once per file and attribute set, then cloned for the identical ones.
1297
+ */
889
1298
  declare function htmlLayoutPlugin(options?: HtmlLayoutOptions): Plugin;
890
1299
  //#endregion
891
1300
  //#region src/plugins/html-markdown/html-markdown-plugin.d.ts
@@ -909,9 +1318,32 @@ interface HtmlMarkdownOptions {
909
1318
  */
910
1319
  sourceAttribute?: string;
911
1320
  }
1321
+ /**
1322
+ * Renders markdown inside HTML pages, from a file or from the element's own text (names configurable via HtmlMarkdownOptions).
1323
+ *
1324
+ * - An element carrying the "markdown" attribute has its text rendered and replaced by the resulting HTML, and loses the attribute.
1325
+ * - A "<markdown src=...>" tag is replaced by the rendered contents of the file it points at.
1326
+ *
1327
+ * Notes:
1328
+ *
1329
+ * - Runs in development and production alike.
1330
+ * - The rendered HTML goes through the normal pipeline (resolve, load, transform), so its own tags are processed like the rest of
1331
+ * the page and a referenced file's links are rebased onto the page that renders it.
1332
+ * - Editing a referenced markdown file recompiles the pages that render it.
1333
+ */
912
1334
  declare function htmlMarkdownPlugin(options?: HtmlMarkdownOptions): Plugin;
913
1335
  //#endregion
914
1336
  //#region src/plugins/html-merge-styles/html-merge-styles-plugin.d.ts
1337
+ /**
1338
+ * Merges consecutive "<style>" tags in the "<head>" into a single tag, cutting the number of style blocks a page ships.
1339
+ *
1340
+ * Notes:
1341
+ *
1342
+ * - Production only, and only inside "<head>"; styles anywhere else are left alone.
1343
+ * - A run is only merged when the tags carry identical attributes, and a "<link rel=stylesheet>" between them breaks the run, so
1344
+ * the cascade order never changes.
1345
+ * - The merged rules are appended to the first tag of the run and the others are removed.
1346
+ */
915
1347
  declare function htmlMergeStylesPlugin(): Plugin;
916
1348
  //#endregion
917
1349
  //#region src/plugins/html-pages/html-pages-plugin.d.ts
@@ -929,6 +1361,23 @@ interface HtmlPagesOptions {
929
1361
  */
930
1362
  outputDir?: string;
931
1363
  }
1364
+ /**
1365
+ * Turns the files under the pages directory into routes: every ".html" and ".md" file in "pagesDir" is emitted at its clean URL
1366
+ * path, and the links pointing into the directory are rewritten to match.
1367
+ *
1368
+ * - "pages/home.html" becomes "home/index.html", so it is served at "/home/", while a file already named "index" keeps its place.
1369
+ * - Markdown pages are rendered to HTML first, and the markdown itself is kept out of the output.
1370
+ * - Square brackets mark a dynamic route: "pages/users/[id].html" is expanded into one page per entry returned by the
1371
+ * "getStaticPaths" export of its "<script params>" tag, with "{{ $params.x }}" and "{{ $props.x }}" filled in.
1372
+ *
1373
+ * Notes:
1374
+ *
1375
+ * - Rebasing goes both ways: a page's own links survive the move out of "pagesDir", and links from anywhere else pointing into it
1376
+ * are rewritten to the final URL.
1377
+ * - "outputDir" puts the whole route tree under a subdirectory of the output.
1378
+ * - The dev server resolves a request through the same computed paths, with or without the trailing "index.html", dynamic routes
1379
+ * included.
1380
+ */
932
1381
  declare function htmlPagesPlugin(options?: HtmlPagesOptions): Plugin;
933
1382
  //#endregion
934
1383
  //#region src/plugins/html-preload/html-preload-plugin.d.ts
@@ -942,16 +1391,34 @@ interface HtmlPreloadOptions {
942
1391
  /**
943
1392
  * Attribute name for including files.
944
1393
  *
945
- * @default "include"
1394
+ * @default "preload-include"
946
1395
  */
947
1396
  includeAttribute?: string;
948
1397
  /**
949
1398
  * Attribute name for excluding files.
950
1399
  *
951
- * @default "exclude"
1400
+ * @default "preload-exclude"
952
1401
  */
953
1402
  excludeAttribute?: string;
954
1403
  }
1404
+ /**
1405
+ * Adds "<link rel=preload>" tags to the "<head>" for the dependencies of the scripts and stylesheets marked with "preload"
1406
+ * (attribute names configurable via HtmlPreloadOptions), so the browser starts fetching them before parsing gets that far.
1407
+ *
1408
+ * Attributes:
1409
+ *
1410
+ * - "preload": marks the tag. Its value narrows what to emit to a space-separated list of "script", "style", "fetch", "font",
1411
+ * "audio", "video" and "image"; an empty value means all of them.
1412
+ * - "preload-include" and "preload-exclude": semicolon-separated glob patterns, matched against paths relative to the project root.
1413
+ *
1414
+ * Notes:
1415
+ *
1416
+ * - Production only; in development the three attributes are just stripped.
1417
+ * - Handles "<script>", "<style>" and "<link rel=stylesheet>" tags. The attribute on any other tag emits nothing.
1418
+ * - The dependency walk covers the whole graph behind the tag (imports, "@import", "url()") plus the file it points at, and files
1419
+ * whose extension has no known "as" type are skipped.
1420
+ * - The links are appended at the end of "<head>", so they come after whatever the page already has there.
1421
+ */
955
1422
  declare function htmlPreloadPlugin(options?: HtmlPreloadOptions): Plugin;
956
1423
  //#endregion
957
1424
  //#region src/plugins/core-plugins/html-metadata/html-metadata-plugin.d.ts
@@ -963,6 +1430,19 @@ interface CoreHtmlPluginOptions {
963
1430
  */
964
1431
  minifyAttribute?: string;
965
1432
  }
1433
+ /**
1434
+ * The HTML half of the core pipeline: parses a page into a document, splits its "<script>" and "<style>" tags into metadata of
1435
+ * their own, and prints the whole thing back out.
1436
+ *
1437
+ * Notes:
1438
+ *
1439
+ * - Each inline script or style is tied to its tag by an internal id attribute, which is stripped from the printed output.
1440
+ * - Sources come from the page's links plus the sources of every extracted script and style, so an import inside an inline script
1441
+ * counts as a dependency of the page.
1442
+ * - A "minify" attribute on a single tag minifies just that tag regardless of the build settings, and when the rest of the page is
1443
+ * formatted such a tag is preceded by a "prettier-ignore" comment so it stays that way.
1444
+ * - Rebasing a page carries its inline scripts and styles along with it.
1445
+ */
966
1446
  declare function coreHtmlPlugin(options?: CoreHtmlPluginOptions): Plugin;
967
1447
  //#endregion
968
1448
  //#region src/plugins/core-plugins/markdown-metadata/markdown-metadata-plugin.d.ts
@@ -996,18 +1476,69 @@ interface CoreMarkdownPluginOptions {
996
1476
  */
997
1477
  allowDangerousHtml?: boolean;
998
1478
  }
1479
+ /**
1480
+ * The markdown half of the core pipeline: parses ".md" files with remark, exposes their YAML front matter, and renders them to
1481
+ * HTML on demand through "ast.render()".
1482
+ *
1483
+ * The remark chain is front matter, GFM and smartypants, then "remarkPlugins"; rendering runs remark-rehype, heading slugs and
1484
+ * external links (opened in a new tab, with "noopener noreferrer"), then "rehypePlugins".
1485
+ *
1486
+ * Notes:
1487
+ *
1488
+ * - Raw HTML inside the markdown is dropped unless "allowDangerousHtml" is on.
1489
+ * - Front matter is only read from the very first node, and only when it is a YAML block.
1490
+ * - Links and images are reported as sources, so they get resolved and rebased; anything inside raw HTML is not.
1491
+ * - Printing this metadata gives markdown back, not HTML.
1492
+ */
999
1493
  declare function coreMarkdownPlugin(options?: CoreMarkdownPluginOptions): Plugin;
1000
1494
  //#endregion
1001
1495
  //#region src/plugins/core-plugins/script-metadata/script-metadata-plugin.d.ts
1496
+ /**
1497
+ * The script half of the core pipeline: loads JavaScript and TypeScript files (".js", ".mjs", ".cjs", ".jsx", ".ts", ".mts",
1498
+ * ".cts", ".tsx") into a Babel AST, prints them back out, and reports their imports as sources.
1499
+ *
1500
+ * Notes:
1501
+ *
1502
+ * - Loading only parses. Stripping types and JSX is transformJsPlugin's job.
1503
+ * - Printing goes through Babel; "format" hands the result to prettier and "minify" to SWC, which is told whether the file is a
1504
+ * module or a classic script.
1505
+ */
1002
1506
  declare function coreScriptPlugin(): Plugin;
1003
1507
  //#endregion
1004
1508
  //#region src/plugins/core-plugins/style-metadata/style-metadata-plugin.d.ts
1509
+ /**
1510
+ * The style half of the core pipeline: loads ".css" files into a PostCSS AST, prints them back out, and reports their "@import"
1511
+ * and "url()" references as sources.
1512
+ *
1513
+ * Notes:
1514
+ *
1515
+ * - "format" hands the result to prettier; "minify" runs Lightning CSS against the project's browserslist, resolved once and reused
1516
+ * for the rest of the build.
1517
+ */
1005
1518
  declare function coreStylePlugin(): Plugin;
1006
1519
  //#endregion
1007
1520
  //#region src/plugins/core-plugins/svg-metadata/svg-metadata-plugin.d.ts
1521
+ /**
1522
+ * The SVG half of the core pipeline: parses ".svg" files as documents, splits their "<style>" tags into metadata of their own,
1523
+ * and prints them back out.
1524
+ *
1525
+ * Notes:
1526
+ *
1527
+ * - Sources come from the document's own links plus the sources of the extracted styles.
1528
+ * - "format" runs prettier as HTML, and "minify" goes through the HTML minifier.
1529
+ */
1008
1530
  declare function coreSvgPlugin(): Plugin;
1009
1531
  //#endregion
1010
1532
  //#region src/plugins/core-plugins/web-manifest-metadata/web-manifest-metadata-plugin.d.ts
1533
+ /**
1534
+ * The web app manifest half of the core pipeline: loads a "manifest.json" as JSON data and reports the assets it points at.
1535
+ *
1536
+ * Notes:
1537
+ *
1538
+ * - Detection is by file name, so a manifest under a different name is only picked up when the type is passed explicitly.
1539
+ * - Icons, screenshots and shortcut icons are reported as sources, so their paths are resolved and rebased with everything else.
1540
+ * - Printing gives compact JSON, or indented when formatting.
1541
+ */
1011
1542
  declare function coreWebManifestPlugin(): Plugin;
1012
1543
  //#endregion
1013
1544
  //#region src/plugins/core-plugins/development-server/development-server-plugin.d.ts
@@ -1030,7 +1561,30 @@ interface DevelopmentServerOptions {
1030
1561
  * @default /
1031
1562
  */
1032
1563
  entry?: string;
1564
+ /**
1565
+ * Files in the public directory are served from the root as a fallback.
1566
+ *
1567
+ * @default "public"
1568
+ */
1569
+ publicDirectory?: string;
1033
1570
  }
1571
+ /**
1572
+ * The dev server: serves the build from memory over Fastify, compiles pages on demand, and pushes updates to the browser over a
1573
+ * web socket.
1574
+ *
1575
+ * Notes:
1576
+ *
1577
+ * - Development only.
1578
+ * - A request is answered from what is already compiled; otherwise the path is resolved to an entry point and compiled on the spot,
1579
+ * with a directory path getting "index.html" appended. Anything that is not an entry point falls through to the static handler,
1580
+ * which serves the project root and the public directory.
1581
+ * - The reload script is injected into HTML entry points as they are served, so it never exists in the built output.
1582
+ * - On a change, the affected pages are recompiled in dependency order and metadata nothing references any more is dropped. If only
1583
+ * CSS changed the stylesheets are swapped in place, otherwise the page reloads.
1584
+ * - Compiled pages are trimmed to the number of connected clients, dropping the least recently served ones.
1585
+ * - Closing the app drops the connected clients and stops the server, which frees the port for the next one; the browser reloads
1586
+ * itself as soon as it reconnects.
1587
+ */
1034
1588
  declare function developmentServerPlugin(options?: DevelopmentServerOptions): Plugin;
1035
1589
  //#endregion
1036
1590
  //#region src/plugins/cli-plugins/build/build-cli-plugin.d.ts
@@ -1048,6 +1602,14 @@ interface BuildCliPluginOptions {
1048
1602
  */
1049
1603
  aliases?: string[];
1050
1604
  }
1605
+ /**
1606
+ * Adds the "build" command (aliased "b"): runs the pipeline once in production mode and reports how long it took.
1607
+ *
1608
+ * Notes:
1609
+ *
1610
+ * - The command owns the run. It forces production mode onto the config and creates its own App.
1611
+ * - "--measure" turns on per-plugin hook timing and prints the report when the build finishes.
1612
+ */
1051
1613
  declare function buildCliPlugin(options?: BuildCliPluginOptions): Plugin;
1052
1614
  //#endregion
1053
1615
  //#region src/plugins/cli-plugins/convert-fonts/convert-fonts-cli-plugin.d.ts
@@ -1083,6 +1645,15 @@ interface ConvertFontsCliPluginOptions {
1083
1645
  */
1084
1646
  outDir?: string;
1085
1647
  }
1648
+ /**
1649
+ * Adds the "convert-fonts" command (aliased "woff2"): converts the TTF files matched by "--fonts" to WOFF2.
1650
+ *
1651
+ * Notes:
1652
+ *
1653
+ * - The options given here become the defaults of the matching flags; a flag left without one has to be passed on the command line.
1654
+ * - Every font lands directly in "--out-dir" under its own name, so the source directory structure is flattened and fonts that
1655
+ * share a name overwrite each other.
1656
+ */
1086
1657
  declare function convertFontsCliPlugin(options?: ConvertFontsCliPluginOptions): Plugin;
1087
1658
  //#endregion
1088
1659
  //#region src/plugins/cli-plugins/generate-font-face/generate-font-face-cli-plugin.d.ts
@@ -1120,10 +1691,20 @@ interface GenerateFontFacesCliPluginOptions {
1120
1691
  /**
1121
1692
  * The default value of the `fontDisplay` option.
1122
1693
  *
1123
- * @default "auto"
1694
+ * @default "swap"
1124
1695
  */
1125
1696
  fontDisplay?: "auto" | "block" | "swap" | "fallback" | "optional";
1126
1697
  }
1698
+ /**
1699
+ * Adds the "fontface" command (aliased "font"): writes one stylesheet of "@font-face" rules for the fonts matched by "--fonts".
1700
+ *
1701
+ * Notes:
1702
+ *
1703
+ * - Family, weight and style are read from the font's own tables, not from its file name, and the format comes from the extension.
1704
+ * - The "src" path of each rule is written relative to "--css-out", and the file is overwritten as a whole on every run.
1705
+ * - The options given here become the defaults of the matching flags; "--font-display" falls back to "swap".
1706
+ * - Matching no font at all is reported and nothing is written.
1707
+ */
1127
1708
  declare function generateFontFacesCliPlugin(options?: GenerateFontFacesCliPluginOptions): Plugin;
1128
1709
  //#endregion
1129
1710
  //#region src/plugins/cli-plugins/material-you/material-you/types.d.ts
@@ -1164,6 +1745,17 @@ interface MaterialYouCliPluginOptions {
1164
1745
  */
1165
1746
  raw?: boolean;
1166
1747
  }
1748
+ /**
1749
+ * Adds the "palette" command (aliased "material-you"): generates a Material You palette from a seed color and prints it.
1750
+ *
1751
+ * Notes:
1752
+ *
1753
+ * - "--color" takes a full "#RRGGBB" hex; anything else is rejected.
1754
+ * - "--format css" prints formatted custom properties ("--clr-*", with the seed and style recorded), "--format json" prints the raw
1755
+ * tone arrays. The pure black and white ends are left out of the CSS.
1756
+ * - The output is syntax highlighted unless "--raw" is passed, which is what you want when redirecting into a file.
1757
+ * - Nothing is written to disk; the palette goes to stdout.
1758
+ */
1167
1759
  declare function materialYouCliPlugin(options?: MaterialYouCliPluginOptions): Plugin;
1168
1760
  //#endregion
1169
1761
  //#region src/plugins/cli-plugins/serve/serve-cli-plugin.d.ts
@@ -1181,7 +1773,19 @@ interface ServeCliPluginOptions {
1181
1773
  */
1182
1774
  aliases?: string[];
1183
1775
  }
1776
+ /**
1777
+ * Adds the "serve" command (aliased "dev"): runs the pipeline in development mode, which is what starts the dev server.
1778
+ *
1779
+ * Notes:
1780
+ *
1781
+ * - The command owns the run. It forces development mode onto the config and creates its own App.
1782
+ * - Serving itself belongs to developmentServerPlugin; this only starts the app in the right mode.
1783
+ * - The config file is watched. When it changes it is loaded again, the running app is closed and a new one starts from the new
1784
+ * config. A config that fails to load leaves the running app alone; a new app that fails to start is closed, so nothing is
1785
+ * served until the next save. Plugins have to be created inside the config file: only that file is evaluated again, so plugin
1786
+ * objects imported from elsewhere would be the same ones the closed app used, and those are refused.
1787
+ */
1184
1788
  declare function serveCliPlugin(options?: ServeCliPluginOptions): Plugin;
1185
1789
  //#endregion
1186
- export { AnalyzeOutputOptions, BuildCliPluginOptions, BundlePackagesOptions, ConvertFontsCliPluginOptions, ConvertImageOptions, CopyAssetsOptions, CoreHtmlPluginOptions, CoreMarkdownPluginOptions, type CssLinear, CustomEasePluginOptions, DevelopmentServerOptions, GenerateFontFacesCliPluginOptions, HtmlBuildTimeScriptOptions, HtmlBundleScriptOptions, HtmlBundleStyleOptions, HtmlFragmentOptions, HtmlIifeScriptOptions, HtmlInlineScriptOptions, HtmlInlineStyleOptions, HtmlInlineSvgOptions, HtmlInlineSvgPlugin, HtmlInlineTextOptions, HtmlInsertOptions, HtmlLayoutOptions, HtmlMarkdownOptions, HtmlPagesOptions, HtmlPreloadOptions, I18nPluginOptions, ImageFormat, ImagePreset, type ImportAsStringOptions, LoadSourcesPluginOptions, MaterialYouCliPluginOptions, RobotsTextOptions, ServeCliPluginOptions, ServiceWorkerOptions, SitemapOptions, TransformCssOptions, TransformJsPluginOptions, WebManifestOptions, WriteFilesOptions, analyzeOutputPlugin, buildCliPlugin, bundlePackagesPlugin, convertFontsCliPlugin, convertImagePlugin, copyAssetsPlugin, coreHtmlPlugin, coreMarkdownPlugin, coreScriptPlugin, coreStylePlugin, coreSvgPlugin, coreWebManifestPlugin, customEasePlugin, developmentServerPlugin, generateFontFacesCliPlugin, htmlBuildTimeScript, htmlBundleScriptPlugin, htmlBundleStylePlugin, htmlFragmentPlugin, htmlIifeScriptPlugin, htmlInlineScriptPlugin, htmlInlineStylePlugin, htmlInlineTextPlugin, htmlInsertPlugin, htmlLayoutPlugin, htmlMarkdownPlugin, htmlMergeStylesPlugin, htmlPagesPlugin, htmlPreloadPlugin, svgoPlugin as htmlSvgoPlugin, svgoPlugin, i18nPlugin, importAsStringPlugin, type import_as_string, loadSourcesPlugin, materialYouCliPlugin, robotsTextPlugin, serveCliPlugin, serviceWorkerPlugin, sitemapPlugin, svgoOptions, transformCssPlugin, transformJsPlugin, webManifestPlugin, writeFilesPlugin };
1790
+ export { type AnalyzeOutputOptions, type BuildCliPluginOptions, type BundlePackagesOptions, type ConvertFontsCliPluginOptions, type ConvertImageOptions, type CopyAssetsOptions, type CoreHtmlPluginOptions, type CoreMarkdownPluginOptions, type CssLinear, type CustomEasePluginOptions, type DevelopmentServerOptions, type GenerateFontFacesCliPluginOptions, type HtmlBuildTimeScriptOptions, type HtmlBundleScriptOptions, type HtmlBundleStyleOptions, type HtmlEnvOnlyOptions, type HtmlFragmentOptions, type HtmlIifeScriptOptions, type HtmlInlineScriptOptions, type HtmlInlineStyleOptions, type HtmlInlineSvgOptions, HtmlInlineSvgPlugin, type HtmlInlineTextOptions, type HtmlInsertOptions, type HtmlLayoutOptions, type HtmlMarkdownOptions, type HtmlPagesOptions, type HtmlPreloadOptions, type I18nPluginOptions, type ImageFormat, type ImagePreset, type ImportAsStringOptions, type LoadSourcesPluginOptions, type MaterialYouCliPluginOptions, type RobotsTextOptions, type ServeCliPluginOptions, type ServiceWorkerOptions, type SitemapOptions, type TransformCssOptions, type TransformJsPluginOptions, type WebManifestOptions, type WriteFilesOptions, analyzeOutputPlugin, buildCliPlugin, bundlePackagesPlugin, convertFontsCliPlugin, convertImagePlugin, copyAssetsPlugin, coreHtmlPlugin, coreMarkdownPlugin, coreScriptPlugin, coreStylePlugin, coreSvgPlugin, coreWebManifestPlugin, customEasePlugin, developmentServerPlugin, generateFontFacesCliPlugin, htmlBuildTimeScript, htmlBundleScriptPlugin, htmlBundleStylePlugin, htmlEnvOnlyPlugin, htmlFragmentPlugin, htmlIifeScriptPlugin, htmlInlineScriptPlugin, htmlInlineStylePlugin, htmlInlineTextPlugin, htmlInsertPlugin, htmlLayoutPlugin, htmlMarkdownPlugin, htmlMergeStylesPlugin, htmlPagesPlugin, htmlPreloadPlugin, svgoPlugin as htmlSvgoPlugin, type svgoPlugin, i18nPlugin, importAsStringPlugin, type import_as_string, loadSourcesPlugin, materialYouCliPlugin, robotsTextPlugin, serveCliPlugin, serviceWorkerPlugin, sitemapPlugin, type svgoOptions, transformCssPlugin, transformJsPlugin, webManifestPlugin, writeFilesPlugin };
1187
1791
  //# sourceMappingURL=index.d.mts.map