aboutsummaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/WatchIgnorePlugin.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/webpack/lib/WatchIgnorePlugin.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/webpack/lib/WatchIgnorePlugin.js')
-rw-r--r--node_modules/webpack/lib/WatchIgnorePlugin.js100
1 files changed, 0 insertions, 100 deletions
diff --git a/node_modules/webpack/lib/WatchIgnorePlugin.js b/node_modules/webpack/lib/WatchIgnorePlugin.js
deleted file mode 100644
index 2f81ee839..000000000
--- a/node_modules/webpack/lib/WatchIgnorePlugin.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-"use strict";
-
-const validateOptions = require("schema-utils");
-const schema = require("../schemas/plugins/WatchIgnorePlugin.json");
-
-class IgnoringWatchFileSystem {
- constructor(wfs, paths) {
- this.wfs = wfs;
- this.paths = paths;
- }
-
- watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) {
- const ignored = path =>
- this.paths.some(
- p => (p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0)
- );
-
- const notIgnored = path => !ignored(path);
-
- const ignoredFiles = files.filter(ignored);
- const ignoredDirs = dirs.filter(ignored);
-
- const watcher = this.wfs.watch(
- files.filter(notIgnored),
- dirs.filter(notIgnored),
- missing,
- startTime,
- options,
- (
- err,
- filesModified,
- dirsModified,
- missingModified,
- fileTimestamps,
- dirTimestamps
- ) => {
- if (err) return callback(err);
-
- for (const path of ignoredFiles) {
- fileTimestamps.set(path, 1);
- }
-
- for (const path of ignoredDirs) {
- dirTimestamps.set(path, 1);
- }
-
- callback(
- err,
- filesModified,
- dirsModified,
- missingModified,
- fileTimestamps,
- dirTimestamps
- );
- },
- callbackUndelayed
- );
-
- return {
- close: () => watcher.close(),
- pause: () => watcher.pause(),
- getContextTimestamps: () => {
- const dirTimestamps = watcher.getContextTimestamps();
- for (const path of ignoredDirs) {
- dirTimestamps.set(path, 1);
- }
- return dirTimestamps;
- },
- getFileTimestamps: () => {
- const fileTimestamps = watcher.getFileTimestamps();
- for (const path of ignoredFiles) {
- fileTimestamps.set(path, 1);
- }
- return fileTimestamps;
- }
- };
- }
-}
-
-class WatchIgnorePlugin {
- constructor(paths) {
- validateOptions(schema, paths, "Watch Ignore Plugin");
- this.paths = paths;
- }
-
- apply(compiler) {
- compiler.hooks.afterEnvironment.tap("WatchIgnorePlugin", () => {
- compiler.watchFileSystem = new IgnoringWatchFileSystem(
- compiler.watchFileSystem,
- this.paths
- );
- });
- }
-}
-
-module.exports = WatchIgnorePlugin;