@unocss/nuxt 66.4.0 → 66.4.2

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 +4 -13
  2. package/package.json +15 -18
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, extendViteConfig, extendWebpackConfig } from '@nuxt/kit';
4
+ import { defineNuxtModule, addPluginTemplate, addComponentsDir, addTemplate, findPath, isNuxtMajorVersion, extendViteConfig, extendWebpackConfig } from '@nuxt/kit';
5
5
  import { createRecoveryConfigLoader } from '@unocss/config';
6
6
  import { cssIdRE } from '@unocss/core';
7
7
  import presetAttributify from '@unocss/preset-attributify';
@@ -14,7 +14,7 @@ import presetWind4 from '@unocss/preset-wind4';
14
14
 
15
15
  const defaultPipelineExclude = [cssIdRE];
16
16
 
17
- async function resolveOptions(options) {
17
+ function resolveOptions(options) {
18
18
  if (options.wind3 && options.wind4) {
19
19
  console.warn("[unocss/nuxt]: wind3 and wind4 presets are mutually exclusive. wind3 will be disabled in favor of wind4.");
20
20
  options.wind3 = false;
@@ -83,7 +83,7 @@ const index = defineNuxtModule({
83
83
  getContents: () => {
84
84
  const lines = [
85
85
  InjectModes.includes(options.mode) ? "import 'uno.css'" : "",
86
- isNuxt2() ? "export default () => {}" : "import { defineNuxtPlugin } from '#imports'; export default defineNuxtPlugin(() => {})"
86
+ "import { defineNuxtPlugin } from '#imports'; export default defineNuxtPlugin(() => {})"
87
87
  ];
88
88
  if (options.preflight)
89
89
  lines.unshift("import '@unocss/reset/tailwind.css'");
@@ -120,7 +120,7 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
120
120
  [],
121
121
  options
122
122
  );
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")) {
123
+ if (isNuxtMajorVersion(3, nuxt) && nuxt.options.builder === "@nuxt/vite-builder" && nuxt.options.postcss.plugins.cssnano && unoConfig.transformers?.some((t) => t.name === "@unocss/transformer-directives" && t.enforce !== "pre")) {
124
124
  const preset = nuxt.options.postcss.plugins.cssnano.preset;
125
125
  nuxt.options.postcss.plugins.cssnano = {
126
126
  preset: [preset?.[0] || "default", Object.assign(
@@ -157,15 +157,6 @@ export default mergeConfigs([${configPaths.map((_, index) => `cfg${index}`).join
157
157
  });
158
158
  });
159
159
  }
160
- if (isNuxt2()) {
161
- nuxt.hook("app:resolve", (config) => {
162
- const plugin = { src: "unocss.mjs", mode: "client" };
163
- if (config.plugins)
164
- config.plugins.push(plugin);
165
- else
166
- config.plugins = [plugin];
167
- });
168
- }
169
160
  }
170
161
  });
171
162
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/nuxt",
3
3
  "type": "module",
4
- "version": "66.4.0",
4
+ "version": "66.4.2",
5
5
  "description": "Nuxt module for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -38,23 +38,20 @@
38
38
  "runtime"
39
39
  ],
40
40
  "dependencies": {
41
- "@nuxt/kit": "^3.18.0",
42
- "@unocss/config": "66.4.0",
43
- "@unocss/preset-attributify": "66.4.0",
44
- "@unocss/preset-tagify": "66.4.0",
45
- "@unocss/preset-typography": "66.4.0",
46
- "@unocss/preset-icons": "66.4.0",
47
- "@unocss/core": "66.4.0",
48
- "@unocss/preset-web-fonts": "66.4.0",
49
- "@unocss/preset-wind4": "66.4.0",
50
- "@unocss/reset": "66.4.0",
51
- "@unocss/vite": "66.4.0",
52
- "@unocss/preset-wind3": "66.4.0",
53
- "@unocss/webpack": "66.4.0",
54
- "unocss": "66.4.0"
55
- },
56
- "devDependencies": {
57
- "@nuxt/schema": "^3.18.0"
41
+ "@nuxt/kit": "^4.0.2",
42
+ "@unocss/core": "66.4.2",
43
+ "@unocss/preset-attributify": "66.4.2",
44
+ "@unocss/preset-typography": "66.4.2",
45
+ "@unocss/preset-icons": "66.4.2",
46
+ "@unocss/preset-tagify": "66.4.2",
47
+ "@unocss/preset-web-fonts": "66.4.2",
48
+ "@unocss/preset-wind3": "66.4.2",
49
+ "@unocss/preset-wind4": "66.4.2",
50
+ "@unocss/config": "66.4.2",
51
+ "@unocss/reset": "66.4.2",
52
+ "@unocss/vite": "66.4.2",
53
+ "@unocss/webpack": "66.4.2",
54
+ "unocss": "66.4.2"
58
55
  },
59
56
  "scripts": {
60
57
  "build": "unbuild",