@unocss/astro 0.55.1 → 0.55.3

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
@@ -4,9 +4,9 @@ const node_path = require('node:path');
4
4
  const node_url = require('node:url');
5
5
  const VitePlugin = require('@unocss/vite');
6
6
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
7
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
8
8
 
9
- const VitePlugin__default = /*#__PURE__*/_interopDefaultLegacy(VitePlugin);
9
+ const VitePlugin__default = /*#__PURE__*/_interopDefaultCompat(VitePlugin);
10
10
 
11
11
  const RESOLVED_ID_RE = /[\/\\]__uno(?:(_.*?))?\.css$/;
12
12
 
@@ -28,7 +28,7 @@ function AstroVitePlugin(options) {
28
28
  },
29
29
  async resolveId(id, importer) {
30
30
  if (RESOLVED_ID_RE.test(id)) {
31
- return node_path.join(root, id);
31
+ return this.resolve(node_path.join(root, id), importer, { skipSelf: true });
32
32
  }
33
33
  if (id === UNO_INJECT_ID) {
34
34
  if (injectReset) {
@@ -0,0 +1,25 @@
1
+ import { AstroIntegration } from 'astro';
2
+ import { VitePluginConfig } from '@unocss/vite';
3
+ import { UserConfigDefaults } from '@unocss/core';
4
+
5
+ interface AstroIntegrationConfig<Theme extends object = object> extends VitePluginConfig<Theme> {
6
+ /**
7
+ * Include reset styles
8
+ * When passing `true`, `@unocss/reset/tailwind.css` will be used
9
+ * @default false
10
+ */
11
+ injectReset?: string | boolean;
12
+ /**
13
+ * Inject UnoCSS entry import for every astro page
14
+ * @default true
15
+ */
16
+ injectEntry?: boolean | string;
17
+ /**
18
+ * Inject extra imports for every astro page
19
+ * @default []
20
+ */
21
+ injectExtra?: string[];
22
+ }
23
+ declare function UnoCSSAstroIntegration<Theme extends object>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
24
+
25
+ export { type AstroIntegrationConfig, UnoCSSAstroIntegration as default };
@@ -0,0 +1,25 @@
1
+ import { AstroIntegration } from 'astro';
2
+ import { VitePluginConfig } from '@unocss/vite';
3
+ import { UserConfigDefaults } from '@unocss/core';
4
+
5
+ interface AstroIntegrationConfig<Theme extends object = object> extends VitePluginConfig<Theme> {
6
+ /**
7
+ * Include reset styles
8
+ * When passing `true`, `@unocss/reset/tailwind.css` will be used
9
+ * @default false
10
+ */
11
+ injectReset?: string | boolean;
12
+ /**
13
+ * Inject UnoCSS entry import for every astro page
14
+ * @default true
15
+ */
16
+ injectEntry?: boolean | string;
17
+ /**
18
+ * Inject extra imports for every astro page
19
+ * @default []
20
+ */
21
+ injectExtra?: string[];
22
+ }
23
+ declare function UnoCSSAstroIntegration<Theme extends object>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
24
+
25
+ export { type AstroIntegrationConfig, UnoCSSAstroIntegration as default };
package/dist/index.d.ts CHANGED
@@ -22,4 +22,4 @@ interface AstroIntegrationConfig<Theme extends object = object> extends VitePlug
22
22
  }
23
23
  declare function UnoCSSAstroIntegration<Theme extends object>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
24
24
 
25
- export { AstroIntegrationConfig, UnoCSSAstroIntegration as default };
25
+ export { type AstroIntegrationConfig, UnoCSSAstroIntegration as default };
package/dist/index.mjs CHANGED
@@ -22,7 +22,7 @@ function AstroVitePlugin(options) {
22
22
  },
23
23
  async resolveId(id, importer) {
24
24
  if (RESOLVED_ID_RE.test(id)) {
25
- return join(root, id);
25
+ return this.resolve(join(root, id), importer, { skipSelf: true });
26
26
  }
27
27
  if (id === UNO_INJECT_ID) {
28
28
  if (injectReset) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/astro",
3
- "version": "0.55.1",
3
+ "version": "0.55.3",
4
4
  "description": "UnoCSS integration for Astro",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -45,12 +45,12 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@unocss/core": "0.55.1",
49
- "@unocss/reset": "0.55.1",
50
- "@unocss/vite": "0.55.1"
48
+ "@unocss/core": "0.55.3",
49
+ "@unocss/reset": "0.55.3",
50
+ "@unocss/vite": "0.55.3"
51
51
  },
52
52
  "devDependencies": {
53
- "astro": "^2.10.9"
53
+ "astro": "^2.10.14"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "unbuild",