@unocss/vite 66.3.2 → 66.3.3
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 +9 -24
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import process
|
|
1
|
+
import process from 'node:process';
|
|
2
2
|
import { createRecoveryConfigLoader } from '@unocss/config';
|
|
3
3
|
import { cssIdRE, createGenerator, BetterMap, toEscapedSelector, LAYER_PREFLIGHTS, LAYER_IMPORTS, notNull } from '@unocss/core';
|
|
4
4
|
import { createFilter } from 'unplugin-utils';
|
|
@@ -31,26 +31,11 @@ const defaultPipelineExclude = [cssIdRE];
|
|
|
31
31
|
const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|html)($|\?)/];
|
|
32
32
|
|
|
33
33
|
function deprecationCheck(config) {
|
|
34
|
-
let warned = false;
|
|
35
|
-
function warn(msg) {
|
|
36
|
-
warned = true;
|
|
37
|
-
console.warn(`[unocss] ${msg}`);
|
|
38
|
-
}
|
|
39
|
-
if (config.include)
|
|
40
|
-
warn("`include` option is deprecated, use `content.pipeline.include` instead.");
|
|
41
|
-
if (config.exclude)
|
|
42
|
-
warn("`exclude` option is deprecated, use `content.pipeline.exclude` instead.");
|
|
43
|
-
if (config.extraContent)
|
|
44
|
-
warn("`extraContent` option is deprecated, use `content` instead.");
|
|
45
|
-
if (config.content?.plain)
|
|
46
|
-
warn("`content.plain` option is renamed to `content.inline`.");
|
|
47
|
-
if (warned && typeof process !== "undefined" && process.env.CI)
|
|
48
|
-
throw new Error("deprecation warning");
|
|
49
34
|
}
|
|
50
35
|
|
|
51
36
|
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
|
|
52
37
|
}) {
|
|
53
|
-
let root = process
|
|
38
|
+
let root = process.cwd();
|
|
54
39
|
let rawConfig = {};
|
|
55
40
|
let configFileList = [];
|
|
56
41
|
let uno;
|
|
@@ -81,8 +66,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
81
66
|
await uno.setConfig(rawConfig);
|
|
82
67
|
uno.config.envMode = "dev";
|
|
83
68
|
rollupFilter = rawConfig.content?.pipeline === false ? () => false : createFilter(
|
|
84
|
-
rawConfig.content?.pipeline?.include ||
|
|
85
|
-
rawConfig.content?.pipeline?.exclude ||
|
|
69
|
+
rawConfig.content?.pipeline?.include || defaultPipelineInclude,
|
|
70
|
+
rawConfig.content?.pipeline?.exclude || defaultPipelineExclude,
|
|
86
71
|
{ resolve: typeof configOrPath === "string" ? configOrPath : root }
|
|
87
72
|
);
|
|
88
73
|
tokens.clear();
|
|
@@ -746,7 +731,7 @@ function GlobalModeDevPlugin(ctx) {
|
|
|
746
731
|
async function setWarnTimer() {
|
|
747
732
|
if (!resolved && !resolvedWarnTimer && (await getConfig()).checkImport) {
|
|
748
733
|
resolvedWarnTimer = setTimeout(() => {
|
|
749
|
-
if (process
|
|
734
|
+
if (process.env.TEST || process.env.NODE_ENV === "test")
|
|
750
735
|
return;
|
|
751
736
|
if (!resolved) {
|
|
752
737
|
console.warn(MESSAGE_UNOCSS_ENTRY_NOT_FOUND);
|
|
@@ -1097,8 +1082,8 @@ function VueScopedPlugin(ctx) {
|
|
|
1097
1082
|
async configResolved() {
|
|
1098
1083
|
const { config } = await ctx.ready;
|
|
1099
1084
|
filter = config.content?.pipeline === false ? () => false : createFilter(
|
|
1100
|
-
config.content?.pipeline?.include ??
|
|
1101
|
-
config.content?.pipeline?.exclude ??
|
|
1085
|
+
config.content?.pipeline?.include ?? [/\.vue$/],
|
|
1086
|
+
config.content?.pipeline?.exclude ?? defaultPipelineExclude
|
|
1102
1087
|
);
|
|
1103
1088
|
},
|
|
1104
1089
|
async transform(code, id) {
|
|
@@ -1132,7 +1117,7 @@ function createTransformerPlugins(ctx) {
|
|
|
1132
1117
|
return applyTransformers(ctx, code, "index.html", order).then((t) => t?.code);
|
|
1133
1118
|
};
|
|
1134
1119
|
return {
|
|
1135
|
-
name: `unocss:transformers:${
|
|
1120
|
+
name: `unocss:transformers:${_order}`,
|
|
1136
1121
|
enforce: order,
|
|
1137
1122
|
transform(code, id) {
|
|
1138
1123
|
return applyTransformers(ctx, code, id, order);
|
|
@@ -1156,7 +1141,7 @@ function defineConfig(config) {
|
|
|
1156
1141
|
}
|
|
1157
1142
|
function UnocssPlugin(configOrPath, defaults = {}) {
|
|
1158
1143
|
const ctx = createContext(configOrPath, {
|
|
1159
|
-
envMode: process
|
|
1144
|
+
envMode: process.env.NODE_ENV === "development" ? "dev" : "build",
|
|
1160
1145
|
...defaults,
|
|
1161
1146
|
legacy: typeof configOrPath !== "string" ? configOrPath?.legacy || { renderModernChunks: true } : { renderModernChunks: true }
|
|
1162
1147
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.3.
|
|
4
|
+
"version": "66.3.3",
|
|
5
5
|
"description": "The Vite plugin for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"homepage": "https://unocss.dev",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/unocss/unocss",
|
|
12
|
+
"url": "git+https://github.com/unocss/unocss.git",
|
|
13
13
|
"directory": "packages-integrations/vite"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"pathe": "^2.0.3",
|
|
56
56
|
"tinyglobby": "^0.2.14",
|
|
57
57
|
"unplugin-utils": "^0.2.4",
|
|
58
|
-
"@unocss/
|
|
59
|
-
"@unocss/
|
|
60
|
-
"@unocss/
|
|
58
|
+
"@unocss/config": "66.3.3",
|
|
59
|
+
"@unocss/core": "66.3.3",
|
|
60
|
+
"@unocss/inspector": "66.3.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"vite": "^7.0.
|
|
63
|
+
"vite": "^7.0.2"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "unbuild",
|