@unocss/config 0.47.1 → 0.47.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.cjs +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
12
12
|
|
|
13
|
-
async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSources = []) {
|
|
13
|
+
async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSources = [], defaults = {}) {
|
|
14
14
|
let inlineConfig = {};
|
|
15
15
|
if (typeof configOrPath !== "string") {
|
|
16
16
|
inlineConfig = configOrPath;
|
|
@@ -48,7 +48,7 @@ async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSo
|
|
|
48
48
|
defaults: inlineConfig
|
|
49
49
|
});
|
|
50
50
|
const result = await loader.load();
|
|
51
|
-
result.config = result.config || inlineConfig;
|
|
51
|
+
result.config = Object.assign(defaults, result.config || inlineConfig);
|
|
52
52
|
if (result.config.configDeps) {
|
|
53
53
|
result.sources = [
|
|
54
54
|
...result.sources,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UserConfig } from '@unocss/core';
|
|
1
|
+
import { UserConfig, UserConfigDefaults } from '@unocss/core';
|
|
2
2
|
import { LoadConfigSource, LoadConfigResult } from 'unconfig';
|
|
3
3
|
export { LoadConfigResult, LoadConfigSource } from 'unconfig';
|
|
4
4
|
|
|
5
|
-
declare function loadConfig<U extends UserConfig>(cwd?: string, configOrPath?: string | U, extraConfigSources?: LoadConfigSource[]): Promise<LoadConfigResult<U>>;
|
|
5
|
+
declare function loadConfig<U extends UserConfig>(cwd?: string, configOrPath?: string | U, extraConfigSources?: LoadConfigSource[], defaults?: UserConfigDefaults): Promise<LoadConfigResult<U>>;
|
|
6
6
|
|
|
7
7
|
export { loadConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve, dirname } from 'path';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { createConfigLoader } from 'unconfig';
|
|
4
4
|
|
|
5
|
-
async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSources = []) {
|
|
5
|
+
async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSources = [], defaults = {}) {
|
|
6
6
|
let inlineConfig = {};
|
|
7
7
|
if (typeof configOrPath !== "string") {
|
|
8
8
|
inlineConfig = configOrPath;
|
|
@@ -40,7 +40,7 @@ async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSo
|
|
|
40
40
|
defaults: inlineConfig
|
|
41
41
|
});
|
|
42
42
|
const result = await loader.load();
|
|
43
|
-
result.config = result.config || inlineConfig;
|
|
43
|
+
result.config = Object.assign(defaults, result.config || inlineConfig);
|
|
44
44
|
if (result.config.configDeps) {
|
|
45
45
|
result.sources = [
|
|
46
46
|
...result.sources,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/config",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.3",
|
|
4
4
|
"description": "Config loader for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=14"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unocss/core": "0.47.
|
|
36
|
+
"@unocss/core": "0.47.3",
|
|
37
37
|
"unconfig": "^0.3.7"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|