@unocss/nuxt 0.30.12 → 0.31.2
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.ts +3 -2
- package/dist/index.mjs +19 -15
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { UserConfig } from '@unocss/core';
|
|
2
3
|
import { PresetUnoOptions } from '@unocss/preset-uno';
|
|
3
4
|
import { AttributifyOptions } from '@unocss/preset-attributify';
|
|
4
5
|
import { IconsOptions } from '@unocss/preset-icons';
|
|
5
|
-
import { UserConfig } from '@unocss/core';
|
|
6
6
|
import { WebFontsOptions } from '@unocss/preset-web-fonts';
|
|
7
7
|
import { TypographyOptions } from '@unocss/preset-typography';
|
|
8
8
|
import { PresetWindOptions } from '@unocss/preset-wind';
|
|
@@ -64,6 +64,7 @@ interface UnocssNuxtOptions extends UserConfig {
|
|
|
64
64
|
*/
|
|
65
65
|
wind?: boolean | PresetWindOptions;
|
|
66
66
|
}
|
|
67
|
+
|
|
67
68
|
declare const _default: _nuxt_schema.NuxtModule<UnocssNuxtOptions>;
|
|
68
69
|
|
|
69
70
|
declare module '@nuxt/schema' {
|
|
@@ -75,4 +76,4 @@ declare module '@nuxt/schema' {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
export {
|
|
79
|
+
export { _default as default };
|
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,24 @@ import presetWebFonts from '@unocss/preset-web-fonts';
|
|
|
10
10
|
import presetTypography from '@unocss/preset-typography';
|
|
11
11
|
import presetWind from '@unocss/preset-wind';
|
|
12
12
|
|
|
13
|
+
function resolveOptions(options) {
|
|
14
|
+
if (options.presets == null) {
|
|
15
|
+
options.presets = [];
|
|
16
|
+
if (options.uno)
|
|
17
|
+
options.presets.push(presetUno(typeof options.uno === "boolean" ? {} : options.uno));
|
|
18
|
+
if (options.wind)
|
|
19
|
+
options.presets.push(presetWind(typeof options.wind === "boolean" ? {} : options.wind));
|
|
20
|
+
if (options.attributify)
|
|
21
|
+
options.presets.push(presetAttributify(typeof options.attributify === "boolean" ? {} : options.attributify));
|
|
22
|
+
if (options.icons)
|
|
23
|
+
options.presets.push(presetIcons(typeof options.icons === "boolean" ? {} : options.icons));
|
|
24
|
+
if (options.webFonts)
|
|
25
|
+
options.presets.push(presetWebFonts(typeof options.webFonts === "boolean" ? {} : options.webFonts));
|
|
26
|
+
if (options.typography)
|
|
27
|
+
options.presets.push(presetTypography(typeof options.typography === "boolean" ? {} : options.typography));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
const dir = dirname(fileURLToPath(import.meta.url));
|
|
14
32
|
const index = defineNuxtModule({
|
|
15
33
|
meta: {
|
|
@@ -27,21 +45,7 @@ const index = defineNuxtModule({
|
|
|
27
45
|
wind: false
|
|
28
46
|
},
|
|
29
47
|
setup(options) {
|
|
30
|
-
|
|
31
|
-
options.presets = [];
|
|
32
|
-
if (options.uno)
|
|
33
|
-
options.presets.push(presetUno(typeof options.uno === "boolean" ? {} : options.uno));
|
|
34
|
-
if (options.wind)
|
|
35
|
-
options.presets.push(presetWind(typeof options.wind === "boolean" ? {} : options.wind));
|
|
36
|
-
if (options.attributify)
|
|
37
|
-
options.presets.push(presetAttributify(typeof options.attributify === "boolean" ? {} : options.attributify));
|
|
38
|
-
if (options.icons)
|
|
39
|
-
options.presets.push(presetIcons(typeof options.icons === "boolean" ? {} : options.icons));
|
|
40
|
-
if (options.webFonts)
|
|
41
|
-
options.presets.push(presetWebFonts(typeof options.webFonts === "boolean" ? {} : options.webFonts));
|
|
42
|
-
if (options.typography)
|
|
43
|
-
options.presets.push(presetTypography(typeof options.typography === "boolean" ? {} : options.typography));
|
|
44
|
-
}
|
|
48
|
+
resolveOptions(options);
|
|
45
49
|
if (options.autoImport) {
|
|
46
50
|
addPluginTemplate({
|
|
47
51
|
filename: "unocss.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.2",
|
|
4
4
|
"description": "Nuxt module for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"sideEffects": false,
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@nuxt/kit": "npm:@nuxt/kit-edge@latest",
|
|
40
|
-
"@unocss/core": "0.
|
|
41
|
-
"@unocss/preset-attributify": "0.
|
|
42
|
-
"@unocss/preset-icons": "0.
|
|
43
|
-
"@unocss/preset-typography": "0.
|
|
44
|
-
"@unocss/preset-uno": "0.
|
|
45
|
-
"@unocss/preset-web-fonts": "0.
|
|
46
|
-
"@unocss/preset-wind": "0.
|
|
47
|
-
"@unocss/reset": "0.
|
|
48
|
-
"@unocss/vite": "0.
|
|
49
|
-
"@unocss/webpack": "0.
|
|
50
|
-
"unocss": "0.
|
|
40
|
+
"@unocss/core": "0.31.2",
|
|
41
|
+
"@unocss/preset-attributify": "0.31.2",
|
|
42
|
+
"@unocss/preset-icons": "0.31.2",
|
|
43
|
+
"@unocss/preset-typography": "0.31.2",
|
|
44
|
+
"@unocss/preset-uno": "0.31.2",
|
|
45
|
+
"@unocss/preset-web-fonts": "0.31.2",
|
|
46
|
+
"@unocss/preset-wind": "0.31.2",
|
|
47
|
+
"@unocss/reset": "0.31.2",
|
|
48
|
+
"@unocss/vite": "0.31.2",
|
|
49
|
+
"@unocss/webpack": "0.31.2",
|
|
50
|
+
"unocss": "0.31.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@nuxt/schema": "npm:@nuxt/schema-edge@latest"
|