@bamboocss/vite 1.46.3 → 1.48.0

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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Plugin } from "vite";
2
-
3
2
  //#region src/css.d.ts
4
3
  /**
5
4
  * What a project imports to get the stylesheet.
@@ -67,15 +66,12 @@ interface BambooVitePluginOptions {
67
66
  /**
68
67
  * Vite integration for Bamboo CSS.
69
68
  *
70
- * Two plugins, because they do unrelated jobs on different schedules. The first emits the
71
- * stylesheet as a virtual module and runs in dev and build alike that is the integration,
72
- * and nothing styles without it. The second compiles every Bamboo source call in both dev
73
- * and build; there is no runtime styling fallback.
74
- *
75
- * The compiler runs with `enforce: 'pre'` so it sees module source as close as possible to what
76
- * the CSS extractor reads off disk. A plugin that rewrites style calls before bamboo
77
- * sees them would otherwise make the two disagree, and a folded class could end up
78
- * with no matching rule.
69
+ * Three plugins. The first emits the stylesheet as a virtual module. The second compiles
70
+ * JavaScript and TypeScript with `enforce: 'pre'` so it sees source close to what the CSS
71
+ * extractor reads off disk. The third compiles Vue, Svelte and Astro with `enforce: 'post'`
72
+ * so it folds the framework's compiled JavaScript — a `pre` hook that skipped the raw SFC
73
+ * would never run again on the same id. Script submodules (`type=script`) are SFC paths and
74
+ * therefore fold in the post plugin, after the framework has extracted them.
79
75
  */
80
76
  declare const bamboocss: (options?: BambooVitePluginOptions) => Plugin[];
81
77
  //#endregion
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
+ import MagicString from "magic-string";
2
+ import { Node } from "ts-morph";
1
3
  import { Plugin } from "vite";
2
-
3
4
  //#region src/css.d.ts
4
5
  /**
5
6
  * What a project imports to get the stylesheet.
@@ -67,15 +68,12 @@ interface BambooVitePluginOptions {
67
68
  /**
68
69
  * Vite integration for Bamboo CSS.
69
70
  *
70
- * Two plugins, because they do unrelated jobs on different schedules. The first emits the
71
- * stylesheet as a virtual module and runs in dev and build alike that is the integration,
72
- * and nothing styles without it. The second compiles every Bamboo source call in both dev
73
- * and build; there is no runtime styling fallback.
74
- *
75
- * The compiler runs with `enforce: 'pre'` so it sees module source as close as possible to what
76
- * the CSS extractor reads off disk. A plugin that rewrites style calls before bamboo
77
- * sees them would otherwise make the two disagree, and a folded class could end up
78
- * with no matching rule.
71
+ * Three plugins. The first emits the stylesheet as a virtual module. The second compiles
72
+ * JavaScript and TypeScript with `enforce: 'pre'` so it sees source close to what the CSS
73
+ * extractor reads off disk. The third compiles Vue, Svelte and Astro with `enforce: 'post'`
74
+ * so it folds the framework's compiled JavaScript — a `pre` hook that skipped the raw SFC
75
+ * would never run again on the same id. Script submodules (`type=script`) are SFC paths and
76
+ * therefore fold in the post plugin, after the framework has extracted them.
79
77
  */
80
78
  declare const bamboocss: (options?: BambooVitePluginOptions) => Plugin[];
81
79
  //#endregion