@unocss/config 0.47.0 → 0.47.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.cjs CHANGED
@@ -10,10 +10,10 @@ 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
- inlineConfig = configOrPath;
16
+ inlineConfig = Object.assign({}, defaults, configOrPath);
17
17
  if (inlineConfig.configFile === false) {
18
18
  return {
19
19
  config: inlineConfig,
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,10 +2,10 @@ 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
- inlineConfig = configOrPath;
8
+ inlineConfig = Object.assign({}, defaults, configOrPath);
9
9
  if (inlineConfig.configFile === false) {
10
10
  return {
11
11
  config: inlineConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/config",
3
- "version": "0.47.0",
3
+ "version": "0.47.2",
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.0",
36
+ "@unocss/core": "0.47.2",
37
37
  "unconfig": "^0.3.7"
38
38
  },
39
39
  "scripts": {