@unocss/nuxt 0.63.2 → 0.63.4
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 +13 -20
- 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, isNuxt3, extendWebpackConfig } from '@nuxt/kit';
|
|
4
|
+
import { defineNuxtModule, addPluginTemplate, isNuxt2, addComponentsDir, addTemplate, findPath, isNuxt3, extendViteConfig, 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,13 +111,8 @@ 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();
|
|
119
114
|
}
|
|
120
|
-
async
|
|
115
|
+
nuxt.hook("build:before", async () => {
|
|
121
116
|
const { config: unoConfig } = await loadConfig(
|
|
122
117
|
process.cwd(),
|
|
123
118
|
{ configFile: options.configFile },
|
|
@@ -128,20 +123,23 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
128
123
|
const preset = nuxt.options.postcss.plugins.cssnano.preset;
|
|
129
124
|
nuxt.options.postcss.plugins.cssnano = {
|
|
130
125
|
preset: [preset?.[0] || "default", Object.assign(
|
|
126
|
+
// Following optimizations result in invalid CSS if the directives not transformed yet
|
|
131
127
|
{ mergeRules: false, normalizeWhitespace: false, discardComments: false },
|
|
132
128
|
preset?.[1]
|
|
133
129
|
)]
|
|
134
130
|
};
|
|
135
131
|
}
|
|
136
|
-
return unoConfig;
|
|
137
|
-
}
|
|
138
|
-
nuxt.hook("vite:extend", async ({ config }) => {
|
|
139
|
-
const unoConfig = await loadUnoConfig();
|
|
140
132
|
await nuxt.callHook("unocss:config", unoConfig);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
extendViteConfig(async (config) => {
|
|
134
|
+
config.plugins = config.plugins || [];
|
|
135
|
+
config.plugins.unshift(...VitePlugin({
|
|
136
|
+
mode: options.mode
|
|
137
|
+
}, unoConfig));
|
|
138
|
+
});
|
|
139
|
+
extendWebpackConfig(async (config) => {
|
|
140
|
+
config.plugins = config.plugins || [];
|
|
141
|
+
config.plugins.unshift(WebpackPlugin({}, unoConfig));
|
|
142
|
+
});
|
|
145
143
|
});
|
|
146
144
|
if (nuxt.options.dev) {
|
|
147
145
|
nuxt.hook("devtools:customTabs", (tabs) => {
|
|
@@ -165,11 +163,6 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
|
|
|
165
163
|
config.plugins = [plugin];
|
|
166
164
|
});
|
|
167
165
|
}
|
|
168
|
-
extendWebpackConfig(async (config) => {
|
|
169
|
-
const unoConfig = await loadUnoConfig();
|
|
170
|
-
config.plugins = config.plugins || [];
|
|
171
|
-
config.plugins.unshift(WebpackPlugin({}, unoConfig));
|
|
172
|
-
});
|
|
173
166
|
}
|
|
174
167
|
});
|
|
175
168
|
|
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.4",
|
|
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-attributify": "0.63.
|
|
45
|
-
"@unocss/preset-
|
|
46
|
-
"@unocss/preset-
|
|
47
|
-
"@unocss/preset-
|
|
48
|
-
"@unocss/preset-uno": "0.63.
|
|
49
|
-
"@unocss/preset-wind": "0.63.
|
|
50
|
-
"@unocss/
|
|
51
|
-
"@unocss/
|
|
52
|
-
"@unocss/
|
|
53
|
-
"unocss": "0.63.
|
|
54
|
-
"@unocss/
|
|
42
|
+
"@unocss/config": "0.63.4",
|
|
43
|
+
"@unocss/core": "0.63.4",
|
|
44
|
+
"@unocss/preset-attributify": "0.63.4",
|
|
45
|
+
"@unocss/preset-tagify": "0.63.4",
|
|
46
|
+
"@unocss/preset-icons": "0.63.4",
|
|
47
|
+
"@unocss/preset-typography": "0.63.4",
|
|
48
|
+
"@unocss/preset-uno": "0.63.4",
|
|
49
|
+
"@unocss/preset-wind": "0.63.4",
|
|
50
|
+
"@unocss/reset": "0.63.4",
|
|
51
|
+
"@unocss/vite": "0.63.4",
|
|
52
|
+
"@unocss/preset-web-fonts": "0.63.4",
|
|
53
|
+
"unocss": "0.63.4",
|
|
54
|
+
"@unocss/webpack": "0.63.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@nuxt/schema": "^3.13.2"
|