MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / resolveChainableConfig

Function resolveChainableConfig

packages/webpack5/src/index.ts:174–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172 * Resolve a new instance of the internal chain config with all chain functions applied.
173 */
174export function resolveChainableConfig(): Config {
175 const config = new Config();
176
177 if (!explicitUseConfig) {
178 useConfig(determineProjectFlavor());
179 }
180
181 // apply configs from dependencies
182 // todo: allow opt-out
183 applyExternalConfigs();
184
185 webpackChains
186 .splice(0)
187 .sort((a, b) => {
188 return a.order - b.order;
189 })
190 .forEach(({ chainFn, plugin }) => {
191 try {
192 chainFn(config, env);
193 } catch (err) {
194 if (plugin) {
195 // catch and print errors from plugins
196 return error(`
197 Unable to apply chain function from: ${plugin}.
198 Error is: ${err}
199 `);
200 }
201
202 // otherwise throw - as the error is likely from the user config
203 // or missing env flags (eg. missing platform)
204 throw err;
205 }
206 });
207
208 if (env.verbose) {
209 info('Resolved chainable config (before merges):');
210 info(highlight(config.toString(), { language: 'js' }));
211 }
212
213 return config;
214}
215
216/**
217 * Resolve a "final" configuration that has all chain functions and merges applied.

Callers 1

resolveConfigFunction · 0.85

Calls 9

determineProjectFlavorFunction · 0.90
applyExternalConfigsFunction · 0.90
errorFunction · 0.90
infoFunction · 0.90
useConfigFunction · 0.85
forEachMethod · 0.80
sortMethod · 0.80
spliceMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected