c12 0.1.2 → 0.1.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 CHANGED
@@ -129,13 +129,16 @@ async function loadConfig(opts) {
129
129
  }
130
130
  Object.assign(configRC, rc9__namespace.read({ name: opts.rcFile, dir: opts.cwd }));
131
131
  }
132
- r.config = defu__default(opts.overrides, config, configRC, opts.defaults);
132
+ r.config = defu__default(opts.overrides, config, configRC);
133
133
  if (opts.extend) {
134
134
  await extendConfig(r.config, opts);
135
135
  r.layers = r.config._layers;
136
136
  delete r.config._layers;
137
137
  r.config = defu__default(r.config, ...r.layers.map((e) => e.config));
138
138
  }
139
+ if (opts.defaults) {
140
+ r.config = defu__default(r.config, opts.defaults);
141
+ }
139
142
  return r;
140
143
  }
141
144
  async function extendConfig(config, opts) {
package/dist/index.mjs CHANGED
@@ -105,13 +105,16 @@ async function loadConfig(opts) {
105
105
  }
106
106
  Object.assign(configRC, rc9.read({ name: opts.rcFile, dir: opts.cwd }));
107
107
  }
108
- r.config = defu(opts.overrides, config, configRC, opts.defaults);
108
+ r.config = defu(opts.overrides, config, configRC);
109
109
  if (opts.extend) {
110
110
  await extendConfig(r.config, opts);
111
111
  r.layers = r.config._layers;
112
112
  delete r.config._layers;
113
113
  r.config = defu(r.config, ...r.layers.map((e) => e.config));
114
114
  }
115
+ if (opts.defaults) {
116
+ r.config = defu(r.config, opts.defaults);
117
+ }
115
118
  return r;
116
119
  }
117
120
  async function extendConfig(config, opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c12",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Smart Config Loader",
5
5
  "repository": "unjs/c12",
6
6
  "license": "MIT",