|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
|---|
| 3 | Author Tobias Koppers @sokra
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | "use strict";
|
|---|
| 7 |
|
|---|
| 8 | /** @typedef {import("../Compiler")} Compiler */
|
|---|
| 9 |
|
|---|
| 10 | class AddManagedPathsPlugin {
|
|---|
| 11 | /**
|
|---|
| 12 | * Creates an instance of AddManagedPathsPlugin.
|
|---|
| 13 | * @param {Iterable<string | RegExp>} managedPaths list of managed paths
|
|---|
| 14 | * @param {Iterable<string | RegExp>} immutablePaths list of immutable paths
|
|---|
| 15 | * @param {Iterable<string | RegExp>} unmanagedPaths list of unmanaged paths
|
|---|
| 16 | */
|
|---|
| 17 | constructor(managedPaths, immutablePaths, unmanagedPaths) {
|
|---|
| 18 | this.managedPaths = new Set(managedPaths);
|
|---|
| 19 | this.immutablePaths = new Set(immutablePaths);
|
|---|
| 20 | this.unmanagedPaths = new Set(unmanagedPaths);
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | /**
|
|---|
| 24 | * Applies the plugin by registering its hooks on the compiler.
|
|---|
| 25 | * @param {Compiler} compiler the compiler instance
|
|---|
| 26 | * @returns {void}
|
|---|
| 27 | */
|
|---|
| 28 | apply(compiler) {
|
|---|
| 29 | for (const managedPath of this.managedPaths) {
|
|---|
| 30 | compiler.managedPaths.add(managedPath);
|
|---|
| 31 | }
|
|---|
| 32 | for (const immutablePath of this.immutablePaths) {
|
|---|
| 33 | compiler.immutablePaths.add(immutablePath);
|
|---|
| 34 | }
|
|---|
| 35 | for (const unmanagedPath of this.unmanagedPaths) {
|
|---|
| 36 | compiler.unmanagedPaths.add(unmanagedPath);
|
|---|
| 37 | }
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | module.exports = AddManagedPathsPlugin;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.