Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cached: false,
reasons: false,
source: false,
errorDetails: true,
chunkOrigins: false,
colors: options.colors,
},
state: false, // show bundle valid / invalid
});
const webpackPlugins = [webpackInfoPlugin];
if (glob || existsDirSync(file)) {
const globPattern = glob ? file : directoryToGlob(file, options);
const matcher = anymatch(globPattern);
const parent = globParent(globPattern);
const directory = path.resolve(parent);
const context = normalizePath(path.relative(tmpPath, directory));
const recursive = globPattern.indexOf('**') !== -1; // or via options.recursive?
const optionsHash = hash.MD5(options); // eslint-disable-line new-cap
const entryFilePath = path.join(tmpPath, `${optionsHash}-entry.js`);
const outputFilePath = path.join(tmpPath, optionsHash, `${optionsHash}-output.js`);
function matchModule(mod) { // eslint-disable-line no-inner-declarations
// normalize path to match glob
const correctedPath = path.join(parent, mod);
return matcher(correctedPath);
}
this.watching[type].forEach((pattern, idx) => {
if (pattern && anymatch(pattern)(path)) {
this.handlers[type][idx](path, event, stats);
}
});
}
) {
if (!fsevents) {
throw new Error(
'`fsevents` unavailable (this watcher can only be used on Darwin)',
);
}
super();
this.dot = opts.dot || false;
this.ignored = opts.ignored;
this.glob = Array.isArray(opts.glob) ? opts.glob : [opts.glob];
this.hasIgnore =
Boolean(opts.ignored) && !(Array.isArray(opts) && opts.length > 0);
this.doIgnore = opts.ignored ? anymatch(opts.ignored) : () => false;
this.root = path.resolve(dir);
this.fsEventsWatchStopper = fsevents.watch(
this.root,
this.handleEvent.bind(this),
);
this._tracked = new Set();
FSEventsWatcher.recReaddir(
this.root,
(filepath: string) => {
this._tracked.add(filepath);
},
(filepath: string) => {
this._tracked.add(filepath);
},
export function isExcluded(filepath, excludes) {
return anymatch(excludes, filepath);
}
.on("all", (event, filePath) => {
const logLine = `${filePath} (${event})`;
logger.silly(`[audit] File change: ${logLine}`);
if (!anymatch(cacheFolderGlob, filePath)) {
changedFilesOutsideScope.push(logLine);
} else {
changedFilesInsideScope.push(logLine);
}
});
}
opts.filter = (filepath) => anymatch(ignoreRules, filepath)
}
(currentDir: string) => !ignored || !anymatch(ignored, currentDir),
)
opts.filter = (filepath) => anymatch(ignoreRules, filepath)
}
this.watching[type].forEach((pattern, idx) => {
if (pattern && anymatch(pattern)(path)) {
this.handlers[type][idx](path, event, stats);
}
});
}
const isType = (file: string) =>
match(this.options.types[type as Contribution] || [], file);
const isMatch = files.some(isType);