Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const emitFiles = err => {
if (err) return callback(err);
asyncLib.forEach(
compilation.assets,
(source, file, callback) => {
let targetFile = file;
const queryStringIdx = targetFile.indexOf("?");
if (queryStringIdx >= 0) {
targetFile = targetFile.substr(0, queryStringIdx);
}
const writeOut = err => {
if (err) return callback(err);
const targetPath = this.outputFileSystem.join(
outputPath,
targetFile
);
if (source.existsAt === targetPath) {
source.emitted = false;
compiler.hooks.run.tapAsync("CachePlugin", (compiler, callback) => {
if (!compiler._lastCompilationFileDependencies) return callback();
const fs = compiler.inputFileSystem;
const fileTs = (compiler.fileTimestamps = new Map());
asyncLib.forEach(
compiler._lastCompilationFileDependencies,
(file, callback) => {
fs.stat(file, (err, stat) => {
if (err) {
if (err.code === "ENOENT") return callback();
return callback(err);
}
if (stat.mtime) this.applyMtime(+stat.mtime);
fileTs.set(file, +stat.mtime || Infinity);
callback();
});
},
err => {
addModuleDependencies(
module,
dependencies,
bail,
cacheGroup,
recursive,
callback
) {
const start = this.profile && Date.now();
const currentProfile = this.profile && {};
asyncLib.forEach(
dependencies,
(item, callback) => {
const dependencies = item.dependencies;
const errorAndCallback = err => {
err.origin = module;
err.dependencies = dependencies;
this.errors.push(err);
if (bail) {
callback(err);
} else {
callback();
}
};
const warningAndCallback = err => {
err.origin = module;
addModuleDependencies(
module,
dependencies,
bail,
cacheGroup,
recursive,
callback
) {
const start = this.profile && Date.now();
const currentProfile = this.profile && {};
asyncLib.forEach(
dependencies,
(item, callback) => {
const dependencies = item.dependencies;
const errorAndCallback = err => {
err.origin = module;
err.dependencies = dependencies;
this.errors.push(err);
if (bail) {
callback(err);
} else {
callback();
}
};
const warningAndCallback = err => {
err.origin = module;
const emitFiles = err => {
if (err) return callback(err);
asyncLib.forEach(
compilation.assets,
(source, file, callback) => {
let targetFile = file;
const queryStringIdx = targetFile.indexOf("?");
if (queryStringIdx >= 0) {
targetFile = targetFile.substr(0, queryStringIdx);
}
const writeOut = err => {
if (err) return callback(err);
const targetPath = this.outputFileSystem.join(
outputPath,
targetFile
);
if (source.existsAt === targetPath) {
source.emitted = false;
(compilation, callback) => {
asyncLib.forEach(
compilation.chunks,
(chunk, callback) => {
if (!chunk.isOnlyInitial()) {
callback();
return;
}
const targetPath = compilation.getPath(this.options.path, {
hash: compilation.hash,
chunk
});
const name =
this.options.name &&
compilation.getPath(this.options.name, {
hash: compilation.hash,
chunk
});
(compilation, callback) => {
asyncLib.forEach(
compilation.chunks,
(chunk, callback) => {
if (!chunk.isOnlyInitial()) {
callback();
return;
}
const targetPath = compilation.getPath(this.options.path, {
hash: compilation.hash,
chunk
});
const name =
this.options.name &&
compilation.getPath(this.options.name, {
hash: compilation.hash,
chunk
});
addModuleDependencies(
module,
dependencies,
bail,
cacheGroup,
recursive,
callback
) {
const start = this.profile && Date.now();
const currentProfile = this.profile && {};
asyncLib.forEach(
dependencies,
(item, callback) => {
const dependencies = item.dependencies;
const errorAndCallback = err => {
err.origin = module;
err.dependencies = dependencies;
this.errors.push(err);
if (bail) {
callback(err);
} else {
callback();
}
};
const warningAndCallback = err => {
err.origin = module;
const emitFiles = err => {
if (err) return callback(err);
asyncLib.forEach(
compilation.assets,
(source, file, callback) => {
let targetFile = file;
const queryStringIdx = targetFile.indexOf("?");
if (queryStringIdx >= 0) {
targetFile = targetFile.substr(0, queryStringIdx);
}
const writeOut = err => {
if (err) return callback(err);
const targetPath = this.outputFileSystem.join(
outputPath,
targetFile
);
if (source.existsAt === targetPath) {
source.emitted = false;
addModuleDependencies(
module,
dependencies,
bail,
cacheGroup,
recursive,
callback
) {
const start = this.profile && Date.now();
const currentProfile = this.profile && {};
asyncLib.forEach(
dependencies,
(item, callback) => {
const dependencies = item.dependencies;
const errorAndCallback = err => {
err.origin = module;
err.dependencies = dependencies;
this.errors.push(err);
if (bail) {
callback(err);
} else {
callback();
}
};
const warningAndCallback = err => {
err.origin = module;