@unocss/vite 0.49.8 → 0.50.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.
- package/dist/index.cjs +14 -3
- package/dist/index.mjs +15 -4
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -394,9 +394,20 @@ function GlobalModeBuildPlugin(ctx) {
|
|
|
394
394
|
}
|
|
395
395
|
},
|
|
396
396
|
async configResolved(config) {
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
const distDirs = [
|
|
398
|
+
path.resolve(config.root, config.build.outDir)
|
|
399
|
+
];
|
|
400
|
+
if (config.build.rollupOptions.output) {
|
|
401
|
+
const outputOptions = config.build.rollupOptions.output;
|
|
402
|
+
const outputDirs = Array.isArray(outputOptions) ? outputOptions.map((option) => option.dir).filter(Boolean) : outputOptions.dir ? [outputOptions.dir] : [];
|
|
403
|
+
distDirs.push(...outputDirs.map((dir) => path.isAbsolute(dir) ? dir : path.resolve(config.root, dir)));
|
|
404
|
+
}
|
|
405
|
+
const cssPostPlugin = config.plugins.find((i) => i.name === "vite:css-post");
|
|
406
|
+
const cssPlugin = config.plugins.find((i) => i.name === "vite:css");
|
|
407
|
+
if (cssPostPlugin)
|
|
408
|
+
distDirs.forEach((dir) => cssPostPlugins.set(dir, cssPostPlugin));
|
|
409
|
+
if (cssPlugin)
|
|
410
|
+
distDirs.forEach((dir) => cssPlugins.set(dir, cssPlugin));
|
|
400
411
|
await ready;
|
|
401
412
|
},
|
|
402
413
|
async renderChunk(_, chunk, options) {
|
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 'path';
|
|
7
|
+
import { resolve, isAbsolute, dirname } from 'path';
|
|
8
8
|
import fs from 'fs/promises';
|
|
9
9
|
import fg from 'fast-glob';
|
|
10
10
|
import remapping from '@ampproject/remapping';
|
|
@@ -381,9 +381,20 @@ function GlobalModeBuildPlugin(ctx) {
|
|
|
381
381
|
}
|
|
382
382
|
},
|
|
383
383
|
async configResolved(config) {
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
const distDirs = [
|
|
385
|
+
resolve(config.root, config.build.outDir)
|
|
386
|
+
];
|
|
387
|
+
if (config.build.rollupOptions.output) {
|
|
388
|
+
const outputOptions = config.build.rollupOptions.output;
|
|
389
|
+
const outputDirs = Array.isArray(outputOptions) ? outputOptions.map((option) => option.dir).filter(Boolean) : outputOptions.dir ? [outputOptions.dir] : [];
|
|
390
|
+
distDirs.push(...outputDirs.map((dir) => isAbsolute(dir) ? dir : resolve(config.root, dir)));
|
|
391
|
+
}
|
|
392
|
+
const cssPostPlugin = config.plugins.find((i) => i.name === "vite:css-post");
|
|
393
|
+
const cssPlugin = config.plugins.find((i) => i.name === "vite:css");
|
|
394
|
+
if (cssPostPlugin)
|
|
395
|
+
distDirs.forEach((dir) => cssPostPlugins.set(dir, cssPostPlugin));
|
|
396
|
+
if (cssPlugin)
|
|
397
|
+
distDirs.forEach((dir) => cssPlugins.set(dir, cssPlugin));
|
|
387
398
|
await ready;
|
|
388
399
|
},
|
|
389
400
|
async renderChunk(_, chunk, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"description": "The Vite plugin for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ampproject/remapping": "^2.2.0",
|
|
46
46
|
"@rollup/pluginutils": "^5.0.2",
|
|
47
|
-
"@unocss/config": "0.
|
|
48
|
-
"@unocss/core": "0.
|
|
49
|
-
"@unocss/inspector": "0.
|
|
50
|
-
"@unocss/scope": "0.
|
|
51
|
-
"@unocss/transformer-directives": "0.
|
|
47
|
+
"@unocss/config": "0.50.1",
|
|
48
|
+
"@unocss/core": "0.50.1",
|
|
49
|
+
"@unocss/inspector": "0.50.1",
|
|
50
|
+
"@unocss/scope": "0.50.1",
|
|
51
|
+
"@unocss/transformer-directives": "0.50.1",
|
|
52
52
|
"chokidar": "^3.5.3",
|
|
53
53
|
"fast-glob": "^3.2.12",
|
|
54
|
-
"magic-string": "^0.
|
|
54
|
+
"magic-string": "^0.30.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@unocss/shared-integration": "0.
|
|
58
|
-
"vite": "^4.1.
|
|
57
|
+
"@unocss/shared-integration": "0.50.1",
|
|
58
|
+
"vite": "^4.1.4"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "unbuild",
|