@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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -2
  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';
@@ -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.62.4",
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.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/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"