logger.log(`determined that '${from}' should write to '${filename}'`);
const sourceFilename = normalizePath(path.relative(compiler.context, absoluteFilename)); // If this came from a glob or dir, add it to the file dependencies
logger.log(`interpolated template '${filename}' for '${sourceFilename}'`);
} else {
filename = normalizePath(filename);
} // eslint-disable-next-line consistent-return
return {
sourceFilename,
absoluteFilename,
filename,
source,
info,
force: pattern.force
};
}));
} catch (error) {
compilation.errors.push(
/** @type {WebpackError} */
error);
return;
}
if (copiedResult.length === 0) {
if (pattern.noErrorOnMissing) {
logger.log(`finished to process a pattern from '${normalizedOriginalFrom}' using '${pattern.context}' context to '${pattern.to}'`);
return;
}
const missingError = new Error(`unable to locate '${glob}' glob after filtering paths`);
compilation.errors.push(
/** @type {WebpackError} */
missingError);
return;
}
logger.log(`finished to process a pattern from '${normalizedOriginalFrom}' using '${pattern.context}' context`); // eslint-disable-next-line consistent-return
if (typeof normalizedPattern.transformAll !== "undefined") {
if (typeof normalizedPattern.to === "undefined") {
compilation.errors.push(
/** @type {WebpackError} */
new Error(`Invalid "pattern.to" for the "pattern.from": "${normalizedPattern.from}" and "pattern.transformAll" function. The "to" option must be specified.`));