@unocss/nuxt 0.63.0 → 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 +24 -14
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
|
@@ -111,23 +111,32 @@ 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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
async function loadUnoConfig() {
|
|
121
|
+
const { config: unoConfig } = await loadConfig(
|
|
122
|
+
process.cwd(),
|
|
123
|
+
{ configFile: options.configFile },
|
|
124
|
+
[],
|
|
125
|
+
options
|
|
126
|
+
);
|
|
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")) {
|
|
128
|
+
const preset = nuxt.options.postcss.plugins.cssnano.preset;
|
|
129
|
+
nuxt.options.postcss.plugins.cssnano = {
|
|
130
|
+
preset: [preset?.[0] || "default", Object.assign(
|
|
131
|
+
{ mergeRules: false, normalizeWhitespace: false, discardComments: false },
|
|
132
|
+
preset?.[1]
|
|
133
|
+
)]
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return unoConfig;
|
|
129
137
|
}
|
|
130
138
|
nuxt.hook("vite:extend", async ({ config }) => {
|
|
139
|
+
const unoConfig = await loadUnoConfig();
|
|
131
140
|
await nuxt.callHook("unocss:config", unoConfig);
|
|
132
141
|
config.plugins = config.plugins || [];
|
|
133
142
|
config.plugins.unshift(...VitePlugin({
|
|
@@ -157,6 +166,7 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
157
166
|
});
|
|
158
167
|
}
|
|
159
168
|
extendWebpackConfig(async (config) => {
|
|
169
|
+
const unoConfig = await loadUnoConfig();
|
|
160
170
|
config.plugins = config.plugins || [];
|
|
161
171
|
config.plugins.unshift(WebpackPlugin({}, unoConfig));
|
|
162
172
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.63.
|
|
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/
|
|
43
|
-
"@unocss/
|
|
44
|
-
"@unocss/preset-
|
|
45
|
-
"@unocss/preset-typography": "0.63.
|
|
46
|
-
"@unocss/preset-
|
|
47
|
-
"@unocss/preset-
|
|
48
|
-
"@unocss/preset-
|
|
49
|
-
"@unocss/preset-web-fonts": "0.63.
|
|
50
|
-
"@unocss/preset-wind": "0.63.
|
|
51
|
-
"@unocss/vite": "0.63.
|
|
52
|
-
"@unocss/reset": "0.63.
|
|
53
|
-
"
|
|
54
|
-
"unocss": "0.63.
|
|
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"
|