@unocss/vite 0.45.25 → 0.45.26
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.cjs +4 -4
- package/dist/index.mjs +1 -1
- package/package.json +8 -9
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ const pluginutils = require('@rollup/pluginutils');
|
|
|
8
8
|
const config = require('@unocss/config');
|
|
9
9
|
const crypto = require('crypto');
|
|
10
10
|
const MagicString = require('magic-string');
|
|
11
|
-
const
|
|
11
|
+
const path = require('path');
|
|
12
12
|
const remapping = require('@ampproject/remapping');
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
const url = require('url');
|
|
@@ -305,7 +305,7 @@ function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, getConfig
|
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
307
|
async configResolved(config) {
|
|
308
|
-
const distDir =
|
|
308
|
+
const distDir = path.resolve(config.root, config.build.outDir);
|
|
309
309
|
cssPostPlugins.set(distDir, config.plugins.find((i) => i.name === "vite:css-post"));
|
|
310
310
|
cssPlugins.set(distDir, config.plugins.find((i) => i.name === "vite:css"));
|
|
311
311
|
await ready;
|
|
@@ -874,7 +874,7 @@ function createTransformerPlugins(ctx) {
|
|
|
874
874
|
}));
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
-
const _dirname = typeof __dirname !== "undefined" ? __dirname :
|
|
877
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
878
878
|
const DEVTOOLS_MODULE_ID = "virtual:unocss-devtools";
|
|
879
879
|
const MOCK_CLASSES_MODULE_ID = "virtual:unocss-mock-classes";
|
|
880
880
|
const MOCK_CLASSES_PATH = "/@unocss/mock-classes";
|
|
@@ -984,7 +984,7 @@ function createDevtoolsPlugin(ctx) {
|
|
|
984
984
|
if (id === DEVTOOLS_PATH) {
|
|
985
985
|
if (!clientCode) {
|
|
986
986
|
clientCode = [
|
|
987
|
-
await fs__default.promises.readFile(
|
|
987
|
+
await fs__default.promises.readFile(path.resolve(_dirname, "client.mjs"), "utf-8"),
|
|
988
988
|
`import('${MOCK_CLASSES_MODULE_ID}')`,
|
|
989
989
|
`import('${DEVTOOLS_CSS_PATH}')`
|
|
990
990
|
].join("\n").replace("__POST_PATH__", (config.server?.origin ?? "") + POST_PATH);
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createFilter } from '@rollup/pluginutils';
|
|
|
4
4
|
import { loadConfig } from '@unocss/config';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
6
6
|
import MagicString from 'magic-string';
|
|
7
|
-
import { resolve, dirname } from '
|
|
7
|
+
import { resolve, dirname } from 'path';
|
|
8
8
|
import remapping from '@ampproject/remapping';
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/vite",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.26",
|
|
4
4
|
"description": "The Vite plugin for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,16 +44,15 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ampproject/remapping": "^2.2.0",
|
|
46
46
|
"@rollup/pluginutils": "^4.2.1",
|
|
47
|
-
"@unocss/config": "0.45.
|
|
48
|
-
"@unocss/core": "0.45.
|
|
49
|
-
"@unocss/inspector": "0.45.
|
|
50
|
-
"@unocss/scope": "0.45.
|
|
51
|
-
"@unocss/transformer-directives": "0.45.
|
|
52
|
-
"magic-string": "^0.26.3"
|
|
53
|
-
"pathe": "^0.3.7"
|
|
47
|
+
"@unocss/config": "0.45.26",
|
|
48
|
+
"@unocss/core": "0.45.26",
|
|
49
|
+
"@unocss/inspector": "0.45.26",
|
|
50
|
+
"@unocss/scope": "0.45.26",
|
|
51
|
+
"@unocss/transformer-directives": "0.45.26",
|
|
52
|
+
"magic-string": "^0.26.3"
|
|
54
53
|
},
|
|
55
54
|
"devDependencies": {
|
|
56
|
-
"@unocss/shared-integration": "0.45.
|
|
55
|
+
"@unocss/shared-integration": "0.45.26",
|
|
57
56
|
"vite": "^3.1.2"
|
|
58
57
|
},
|
|
59
58
|
"scripts": {
|