@unocss/nuxt 0.62.4 → 0.63.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -21
  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, extendWebpackConfig, isNuxt3 } from '@nuxt/kit';
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';
@@ -112,27 +112,23 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
112
112
  write: true
113
113
  });
114
114
  }
115
- async function loadUnoConfig() {
116
- const { config: unoConfig } = await loadConfig(
117
- process.cwd(),
118
- { configFile: options.configFile },
119
- [],
120
- options
121
- );
122
- await nuxt.callHook("unocss:config", unoConfig);
123
- 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
- const preset = nuxt.options.postcss.plugins.cssnano.preset;
125
- nuxt.options.postcss.plugins.cssnano = {
126
- preset: [preset?.[0] || "default", Object.assign(
127
- { mergeRules: false, normalizeWhitespace: false, discardComments: false },
128
- preset?.[1]
129
- )]
130
- };
131
- }
132
- return unoConfig;
115
+ const { config: unoConfig } = await loadConfig(
116
+ process.cwd(),
117
+ { configFile: options.configFile },
118
+ [],
119
+ options
120
+ );
121
+ 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")) {
122
+ const preset = nuxt.options.postcss.plugins.cssnano.preset;
123
+ nuxt.options.postcss.plugins.cssnano = {
124
+ preset: [preset?.[0] || "default", Object.assign(
125
+ { mergeRules: false, normalizeWhitespace: false, discardComments: false },
126
+ preset?.[1]
127
+ )]
128
+ };
133
129
  }
134
130
  nuxt.hook("vite:extend", async ({ config }) => {
135
- const unoConfig = await loadUnoConfig();
131
+ await nuxt.callHook("unocss:config", unoConfig);
136
132
  config.plugins = config.plugins || [];
137
133
  config.plugins.unshift(...VitePlugin({
138
134
  mode: options.mode
@@ -161,7 +157,6 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
161
157
  });
162
158
  }
163
159
  extendWebpackConfig(async (config) => {
164
- const unoConfig = await loadUnoConfig();
165
160
  config.plugins = config.plugins || [];
166
161
  config.plugins.unshift(WebpackPlugin({}, unoConfig));
167
162
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/nuxt",
3
3
  "type": "module",
4
- "version": "0.62.4",
4
+ "version": "0.63.0",
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.62.4",
43
- "@unocss/preset-icons": "0.62.4",
44
- "@unocss/core": "0.62.4",
45
- "@unocss/preset-tagify": "0.62.4",
46
- "@unocss/preset-attributify": "0.62.4",
47
- "@unocss/preset-typography": "0.62.4",
48
- "@unocss/preset-uno": "0.62.4",
49
- "@unocss/preset-web-fonts": "0.62.4",
50
- "@unocss/preset-wind": "0.62.4",
51
- "@unocss/reset": "0.62.4",
52
- "@unocss/vite": "0.62.4",
53
- "unocss": "0.62.4",
54
- "@unocss/webpack": "0.62.4"
42
+ "@unocss/core": "0.63.0",
43
+ "@unocss/config": "0.63.0",
44
+ "@unocss/preset-tagify": "0.63.0",
45
+ "@unocss/preset-typography": "0.63.0",
46
+ "@unocss/preset-icons": "0.63.0",
47
+ "@unocss/preset-attributify": "0.63.0",
48
+ "@unocss/preset-uno": "0.63.0",
49
+ "@unocss/preset-web-fonts": "0.63.0",
50
+ "@unocss/preset-wind": "0.63.0",
51
+ "@unocss/vite": "0.63.0",
52
+ "@unocss/reset": "0.63.0",
53
+ "@unocss/webpack": "0.63.0",
54
+ "unocss": "0.63.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@nuxt/schema": "^3.13.2"