@unocss/vite 0.13.0 → 0.14.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.
- package/dist/index.d.ts +2 -14
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -3,19 +3,7 @@ import { Plugin } from 'vite';
|
|
|
3
3
|
import { UserConfig, UnoGenerator, BetterMap, UserConfigDefaults } from '@unocss/core';
|
|
4
4
|
import { LoadConfigResult } from '@unocss/config';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
interface PluginConfig<Theme extends {} = {}> extends UserConfig<Theme> {
|
|
8
|
-
/**
|
|
9
|
-
* Patterns that filter the files being extracted.
|
|
10
|
-
*/
|
|
11
|
-
include?: FilterPattern;
|
|
12
|
-
/**
|
|
13
|
-
* Patterns that filter the files NOT being extracted.
|
|
14
|
-
*/
|
|
15
|
-
exclude?: FilterPattern;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface VitePluginConfig<Theme extends {} = {}> extends PluginConfig<Theme> {
|
|
6
|
+
interface VitePluginConfig<Theme extends {} = {}> extends UserConfig<Theme> {
|
|
19
7
|
/**
|
|
20
8
|
* Enable UnoCSS inspector
|
|
21
9
|
*
|
|
@@ -35,7 +23,7 @@ interface VitePluginConfig<Theme extends {} = {}> extends PluginConfig<Theme> {
|
|
|
35
23
|
mode?: 'global' | 'per-module' | 'vue-scoped' | 'dist-chunk';
|
|
36
24
|
}
|
|
37
25
|
|
|
38
|
-
interface UnocssPluginContext<Config extends
|
|
26
|
+
interface UnocssPluginContext<Config extends UserConfig = UserConfig> {
|
|
39
27
|
ready: Promise<LoadConfigResult<Config>>;
|
|
40
28
|
uno: UnoGenerator;
|
|
41
29
|
tokens: Set<string>;
|
package/dist/index.js
CHANGED
|
@@ -74,8 +74,8 @@ var INCLUDE_COMMENT = "@unocss-include";
|
|
|
74
74
|
var import_pluginutils = __toModule(require("@rollup/pluginutils"));
|
|
75
75
|
var import_config = __toModule(require("@unocss/config"));
|
|
76
76
|
var import_core = __toModule(require("@unocss/core"));
|
|
77
|
-
function createContext(configOrPath, defaults = {}) {
|
|
78
|
-
const loadConfig = (0, import_config.createConfigLoader)(configOrPath);
|
|
77
|
+
function createContext(configOrPath, defaults = {}, extraConfigSources = []) {
|
|
78
|
+
const loadConfig = (0, import_config.createConfigLoader)(configOrPath, extraConfigSources);
|
|
79
79
|
let rawConfig = {};
|
|
80
80
|
const uno = (0, import_core.createGenerator)(rawConfig, defaults);
|
|
81
81
|
let rollupFilter = (0, import_pluginutils.createFilter)(defaultInclude, defaultExclude);
|
|
@@ -131,7 +131,7 @@ function createContext(configOrPath, defaults = {}) {
|
|
|
131
131
|
// ../plugins-common/utils.ts
|
|
132
132
|
var import_crypto = __toModule(require("crypto"));
|
|
133
133
|
function getHash(input, length = 8) {
|
|
134
|
-
return (0, import_crypto.createHash)("sha256").update(input).digest("hex").
|
|
134
|
+
return (0, import_crypto.createHash)("sha256").update(input).digest("hex").slice(0, length);
|
|
135
135
|
}
|
|
136
136
|
function getPath(id) {
|
|
137
137
|
return id.replace(/\?.*$/, "");
|
package/dist/index.mjs
CHANGED
|
@@ -40,8 +40,8 @@ var INCLUDE_COMMENT = "@unocss-include";
|
|
|
40
40
|
import { createFilter } from "@rollup/pluginutils";
|
|
41
41
|
import { createConfigLoader } from "@unocss/config";
|
|
42
42
|
import { BetterMap, createGenerator } from "@unocss/core";
|
|
43
|
-
function createContext(configOrPath, defaults = {}) {
|
|
44
|
-
const loadConfig = createConfigLoader(configOrPath);
|
|
43
|
+
function createContext(configOrPath, defaults = {}, extraConfigSources = []) {
|
|
44
|
+
const loadConfig = createConfigLoader(configOrPath, extraConfigSources);
|
|
45
45
|
let rawConfig = {};
|
|
46
46
|
const uno = createGenerator(rawConfig, defaults);
|
|
47
47
|
let rollupFilter = createFilter(defaultInclude, defaultExclude);
|
|
@@ -97,7 +97,7 @@ function createContext(configOrPath, defaults = {}) {
|
|
|
97
97
|
// ../plugins-common/utils.ts
|
|
98
98
|
import { createHash } from "crypto";
|
|
99
99
|
function getHash(input, length = 8) {
|
|
100
|
-
return createHash("sha256").update(input).digest("hex").
|
|
100
|
+
return createHash("sha256").update(input).digest("hex").slice(0, length);
|
|
101
101
|
}
|
|
102
102
|
function getPath(id) {
|
|
103
103
|
return id.replace(/\?.*$/, "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "The Vite plugin for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@rollup/pluginutils": "^4.1.1",
|
|
38
|
-
"@unocss/config": "0.
|
|
39
|
-
"@unocss/core": "0.
|
|
40
|
-
"@unocss/inspector": "0.
|
|
41
|
-
"@unocss/scope": "0.
|
|
38
|
+
"@unocss/config": "0.14.2",
|
|
39
|
+
"@unocss/core": "0.14.2",
|
|
40
|
+
"@unocss/inspector": "0.14.2",
|
|
41
|
+
"@unocss/scope": "0.14.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vite": "^2.6.14"
|