@unocss/nuxt 0.62.4 → 0.63.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.mjs +7 -2
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname, resolve } from 'node:path';
|
|
2
2
|
import process from 'node:process';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { defineNuxtModule, addPluginTemplate, isNuxt2, addComponentsDir, addTemplate, findPath,
|
|
4
|
+
import { defineNuxtModule, addPluginTemplate, isNuxt2, addComponentsDir, addTemplate, findPath, isNuxt3, extendWebpackConfig } from '@nuxt/kit';
|
|
5
5
|
import { createRecoveryConfigLoader } from '@unocss/config';
|
|
6
6
|
import VitePlugin from '@unocss/vite';
|
|
7
7
|
import WebpackPlugin from '@unocss/webpack';
|
|
@@ -111,6 +111,11 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
111
111
|
},
|
|
112
112
|
write: true
|
|
113
113
|
});
|
|
114
|
+
nuxt.hook("app:templatesGenerated", async () => {
|
|
115
|
+
await loadUnoConfig();
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
await loadUnoConfig();
|
|
114
119
|
}
|
|
115
120
|
async function loadUnoConfig() {
|
|
116
121
|
const { config: unoConfig } = await loadConfig(
|
|
@@ -119,7 +124,6 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
119
124
|
[],
|
|
120
125
|
options
|
|
121
126
|
);
|
|
122
|
-
await nuxt.callHook("unocss:config", unoConfig);
|
|
123
127
|
if (isNuxt3() && nuxt.options.builder === "@nuxt/vite-builder" && nuxt.options.postcss.plugins.cssnano && unoConfig.transformers?.some((t) => t.name === "@unocss/transformer-directives" && t.enforce !== "pre")) {
|
|
124
128
|
const preset = nuxt.options.postcss.plugins.cssnano.preset;
|
|
125
129
|
nuxt.options.postcss.plugins.cssnano = {
|
|
@@ -133,6 +137,7 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
133
137
|
}
|
|
134
138
|
nuxt.hook("vite:extend", async ({ config }) => {
|
|
135
139
|
const unoConfig = await loadUnoConfig();
|
|
140
|
+
await nuxt.callHook("unocss:config", unoConfig);
|
|
136
141
|
config.plugins = config.plugins || [];
|
|
137
142
|
config.plugins.unshift(...VitePlugin({
|
|
138
143
|
mode: options.mode
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.63.1",
|
|
5
5
|
"description": "Nuxt module for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@nuxt/kit": "^3.13.2",
|
|
42
|
-
"@unocss/config": "0.
|
|
43
|
-
"@unocss/
|
|
44
|
-
"@unocss/
|
|
45
|
-
"@unocss/preset-
|
|
46
|
-
"@unocss/preset-
|
|
47
|
-
"@unocss/preset-
|
|
48
|
-
"@unocss/preset-
|
|
49
|
-
"@unocss/preset-web-fonts": "0.
|
|
50
|
-
"@unocss/preset-wind": "0.
|
|
51
|
-
"@unocss/
|
|
52
|
-
"@unocss/
|
|
53
|
-
"unocss": "0.
|
|
54
|
-
"@unocss/webpack": "0.
|
|
42
|
+
"@unocss/config": "0.63.1",
|
|
43
|
+
"@unocss/core": "0.63.1",
|
|
44
|
+
"@unocss/preset-attributify": "0.63.1",
|
|
45
|
+
"@unocss/preset-typography": "0.63.1",
|
|
46
|
+
"@unocss/preset-tagify": "0.63.1",
|
|
47
|
+
"@unocss/preset-uno": "0.63.1",
|
|
48
|
+
"@unocss/preset-icons": "0.63.1",
|
|
49
|
+
"@unocss/preset-web-fonts": "0.63.1",
|
|
50
|
+
"@unocss/preset-wind": "0.63.1",
|
|
51
|
+
"@unocss/vite": "0.63.1",
|
|
52
|
+
"@unocss/reset": "0.63.1",
|
|
53
|
+
"unocss": "0.63.1",
|
|
54
|
+
"@unocss/webpack": "0.63.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@nuxt/schema": "^3.13.2"
|