@unocss/astro 0.46.5 → 0.47.1

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.cjs CHANGED
@@ -9,7 +9,8 @@ const VitePlugin__default = /*#__PURE__*/_interopDefaultLegacy(VitePlugin);
9
9
  function UnoCSSAstroIntegration(options = {}, defaults) {
10
10
  const {
11
11
  injectEntry = true,
12
- injectReset: includeReset = true
12
+ injectReset: includeReset = true,
13
+ injectExtra = []
13
14
  } = options;
14
15
  return {
15
16
  name: "unocss",
@@ -26,6 +27,8 @@ function UnoCSSAstroIntegration(options = {}, defaults) {
26
27
  if (injectEntry) {
27
28
  injects.push(typeof injectEntry === "string" ? injectEntry : 'import "uno.css"');
28
29
  }
30
+ if (injectExtra.length > 0)
31
+ injects.push(...injectExtra);
29
32
  if (injects?.length)
30
33
  injectScript("page-ssr", injects.join("\n"));
31
34
  }
package/dist/index.d.ts CHANGED
@@ -14,6 +14,11 @@ interface AstroIntegrationConfig<Theme extends {} = {}> extends VitePluginConfig
14
14
  * @default true
15
15
  */
16
16
  injectEntry?: boolean | string;
17
+ /**
18
+ * Inject extra imports for every astro page
19
+ * @default []
20
+ */
21
+ injectExtra?: string[];
17
22
  }
18
23
  declare function UnoCSSAstroIntegration<Theme extends {}>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
19
24
 
package/dist/index.mjs CHANGED
@@ -3,7 +3,8 @@ import VitePlugin from '@unocss/vite';
3
3
  function UnoCSSAstroIntegration(options = {}, defaults) {
4
4
  const {
5
5
  injectEntry = true,
6
- injectReset: includeReset = true
6
+ injectReset: includeReset = true,
7
+ injectExtra = []
7
8
  } = options;
8
9
  return {
9
10
  name: "unocss",
@@ -20,6 +21,8 @@ function UnoCSSAstroIntegration(options = {}, defaults) {
20
21
  if (injectEntry) {
21
22
  injects.push(typeof injectEntry === "string" ? injectEntry : 'import "uno.css"');
22
23
  }
24
+ if (injectExtra.length > 0)
25
+ injects.push(...injectExtra);
23
26
  if (injects?.length)
24
27
  injectScript("page-ssr", injects.join("\n"));
25
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/astro",
3
- "version": "0.46.5",
3
+ "version": "0.47.1",
4
4
  "description": "UnoCSS integration for Astro",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -37,12 +37,12 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@unocss/core": "0.46.5",
41
- "@unocss/reset": "0.46.5",
42
- "@unocss/vite": "0.46.5"
40
+ "@unocss/core": "0.47.1",
41
+ "@unocss/reset": "0.47.1",
42
+ "@unocss/vite": "0.47.1"
43
43
  },
44
44
  "devDependencies": {
45
- "astro": "^1.6.4"
45
+ "astro": "^1.6.11"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "unbuild",