* build: allow unocss to run through dev mode * build: Update unocss dependencies to latest versions Updated dependencies '@unocss/eslint-config', '@unocss/postcss', '@unocss/preset-uno', '@unocss/preset-web-fonts', '@unocss/reset', '@unocss/transformer-directives', '@unocss/transformer-variant-group' to version 0.58.6 for consistency and compatibility. * refactor: add note to readme * refactor: improve readme * refactor: update readme (again) * Update README.md Updates the UTRP description text --------- Co-authored-by: Isaiah David Rodriguez <51803892+IsaDavRod@users.noreply.github.com>
109 lines
4.7 KiB
Diff
109 lines
4.7 KiB
Diff
diff --git a/dist/index.cjs b/dist/index.cjs
|
|
index 560f423a07f21b0c47abd494d77654de4c874481..35ae1fdca8bd5546f7e40a23edacb1dbbbd34b58 100644
|
|
--- a/dist/index.cjs
|
|
+++ b/dist/index.cjs
|
|
@@ -35,15 +35,15 @@ const VIRTUAL_ENTRY_ALIAS = [
|
|
/^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
|
|
];
|
|
const LAYER_MARK_ALL = "__ALL__";
|
|
-const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]__uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
-const RESOLVED_ID_RE = /[\/\\]__uno(?:_(.*?))?\.css$/;
|
|
+const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
+const RESOLVED_ID_RE = /[\/\\]uno(?:_(.*?))?\.css$/;
|
|
function resolveId(id) {
|
|
if (id.match(RESOLVED_ID_WITH_QUERY_RE))
|
|
return id;
|
|
for (const alias of VIRTUAL_ENTRY_ALIAS) {
|
|
const match = id.match(alias);
|
|
if (match) {
|
|
- return match[1] ? `/__uno_${match[1]}.css` : "/__uno.css";
|
|
+ return match[1] ? `/uno_${match[1]}.css` : "/uno.css";
|
|
}
|
|
}
|
|
}
|
|
@@ -745,7 +745,7 @@ function GlobalModeDevPlugin({ uno, tokens, tasks, flushTasks, affectedModules,
|
|
const { hash, css } = await generateCSS(layer);
|
|
return {
|
|
// add hash to the chunk of CSS that it will send back to client to check if there is new CSS generated
|
|
- code: `__uno_hash_${hash}{--:'';}${css}`,
|
|
+ code: `uno_hash_${hash}{--:'';}${css}`,
|
|
map: { mappings: "" }
|
|
};
|
|
},
|
|
@@ -764,7 +764,7 @@ function GlobalModeDevPlugin({ uno, tokens, tasks, flushTasks, affectedModules,
|
|
if (layer && code.includes("import.meta.hot")) {
|
|
let hmr = `
|
|
try {
|
|
- let hash = __vite__css.match(/__uno_hash_(\\w{${HASH_LENGTH}})/)
|
|
+ let hash = __vite__css.match(/uno_hash_(\\w{${HASH_LENGTH}})/)
|
|
hash = hash && hash[1]
|
|
if (!hash)
|
|
console.warn('[unocss-hmr]', 'failed to get unocss hash, hmr might not work')
|
|
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
index bbbccb7cad7421cbdb97223a451ec5853c0476cb..4bf6a08d94e562090a530308c0ab8337afdf8243 100644
|
|
--- a/dist/index.mjs
|
|
+++ b/dist/index.mjs
|
|
@@ -1,17 +1,17 @@
|
|
-import process$1 from 'node:process';
|
|
+import remapping from '@ampproject/remapping';
|
|
+import { createFilter } from '@rollup/pluginutils';
|
|
+import { loadConfig } from '@unocss/config';
|
|
+import { BetterMap, createGenerator, cssIdRE, notNull, toEscapedSelector } from '@unocss/core';
|
|
import UnocssInspector from '@unocss/inspector';
|
|
-import { resolve, isAbsolute, dirname } from 'node:path';
|
|
-import fs from 'node:fs/promises';
|
|
import fg from 'fast-glob';
|
|
import MagicString from 'magic-string';
|
|
-import remapping from '@ampproject/remapping';
|
|
-import { createHash } from 'node:crypto';
|
|
-import { cssIdRE, createGenerator, BetterMap, notNull, toEscapedSelector } from '@unocss/core';
|
|
import { Buffer } from 'node:buffer';
|
|
-import { createFilter } from '@rollup/pluginutils';
|
|
+import { createHash } from 'node:crypto';
|
|
import fs$1 from 'node:fs';
|
|
+import fs from 'node:fs/promises';
|
|
+import { dirname, isAbsolute, resolve } from 'node:path';
|
|
+import process$1 from 'node:process';
|
|
import { fileURLToPath } from 'node:url';
|
|
-import { loadConfig } from '@unocss/config';
|
|
|
|
const defaultPipelineExclude = [cssIdRE];
|
|
const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/];
|
|
@@ -20,15 +20,15 @@ const VIRTUAL_ENTRY_ALIAS = [
|
|
/^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
|
|
];
|
|
const LAYER_MARK_ALL = "__ALL__";
|
|
-const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]__uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
-const RESOLVED_ID_RE = /[\/\\]__uno(?:_(.*?))?\.css$/;
|
|
+const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
+const RESOLVED_ID_RE = /[\/\\]uno(?:_(.*?))?\.css$/;
|
|
function resolveId(id) {
|
|
if (id.match(RESOLVED_ID_WITH_QUERY_RE))
|
|
return id;
|
|
for (const alias of VIRTUAL_ENTRY_ALIAS) {
|
|
const match = id.match(alias);
|
|
if (match) {
|
|
- return match[1] ? `/__uno_${match[1]}.css` : "/__uno.css";
|
|
+ return match[1] ? `/uno_${match[1]}.css` : "/uno.css";
|
|
}
|
|
}
|
|
}
|
|
@@ -730,7 +730,7 @@ function GlobalModeDevPlugin({ uno, tokens, tasks, flushTasks, affectedModules,
|
|
const { hash, css } = await generateCSS(layer);
|
|
return {
|
|
// add hash to the chunk of CSS that it will send back to client to check if there is new CSS generated
|
|
- code: `__uno_hash_${hash}{--:'';}${css}`,
|
|
+ code: `uno_hash_${hash}{--:'';}${css}`,
|
|
map: { mappings: "" }
|
|
};
|
|
},
|
|
@@ -749,7 +749,7 @@ function GlobalModeDevPlugin({ uno, tokens, tasks, flushTasks, affectedModules,
|
|
if (layer && code.includes("import.meta.hot")) {
|
|
let hmr = `
|
|
try {
|
|
- let hash = __vite__css.match(/__uno_hash_(\\w{${HASH_LENGTH}})/)
|
|
+ let hash = __vite__css.match(/uno_hash_(\\w{${HASH_LENGTH}})/)
|
|
hash = hash && hash[1]
|
|
if (!hash)
|
|
console.warn('[unocss-hmr]', 'failed to get unocss hash, hmr might not work')
|