(options, compilerIndex)
| 311 | * @returns {ResolvedOptions} Resolved options after apply defaults |
| 312 | */ |
| 313 | const applyWebpackOptionsDefaults = (options, compilerIndex) => { |
| 314 | F(options, "context", () => process.cwd()); |
| 315 | F(options, "target", () => |
| 316 | getDefaultTarget(/** @type {string} */ (options.context)) |
| 317 | ); |
| 318 | |
| 319 | const { mode, name, target } = options; |
| 320 | |
| 321 | const targetProperties = |
| 322 | target === false |
| 323 | ? /** @type {false} */ (false) |
| 324 | : typeof target === "string" |
| 325 | ? getTargetProperties(target, /** @type {Context} */ (options.context)) |
| 326 | : getTargetsProperties( |
| 327 | /** @type {string[]} */ (target), |
| 328 | /** @type {Context} */ (options.context) |
| 329 | ); |
| 330 | |
| 331 | const development = mode === "development"; |
| 332 | const production = mode === "production" || !mode; |
| 333 | |
| 334 | if (typeof options.entry !== "function") { |
| 335 | for (const key of Object.keys(options.entry)) { |
| 336 | F( |
| 337 | options.entry[key], |
| 338 | "import", |
| 339 | () => /** @type {[string]} */ (["./src"]) |
| 340 | ); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | F( |
| 345 | options, |
| 346 | "devtool", |
| 347 | () => |
| 348 | /** @type {Devtool} */ ( |
| 349 | development |
| 350 | ? [ |
| 351 | options.experiments.css |
| 352 | ? { |
| 353 | type: "css", |
| 354 | use: "source-map" |
| 355 | } |
| 356 | : undefined, |
| 357 | { |
| 358 | type: "javascript", |
| 359 | use: "eval" |
| 360 | } |
| 361 | ].filter(Boolean) |
| 362 | : false |
| 363 | ) |
| 364 | ); |
| 365 | |
| 366 | D(options, "watch", false); |
| 367 | D(options, "profile", false); |
| 368 | D(options, "parallelism", 100); |
| 369 | D(options, "recordsInputPath", false); |
| 370 | D(options, "recordsOutputPath", false); |
nothing calls this directly
no test coverage detected