Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
852 bytes
|
Rev | Line | |
---|
[6a3a178] | 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 | * @param {Iterable<string>} managedPaths list of managed paths
|
---|
| 13 | * @param {Iterable<string>} immutablePaths list of immutable paths
|
---|
| 14 | */
|
---|
| 15 | constructor(managedPaths, immutablePaths) {
|
---|
| 16 | this.managedPaths = new Set(managedPaths);
|
---|
| 17 | this.immutablePaths = new Set(immutablePaths);
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * Apply the plugin
|
---|
| 22 | * @param {Compiler} compiler the compiler instance
|
---|
| 23 | * @returns {void}
|
---|
| 24 | */
|
---|
| 25 | apply(compiler) {
|
---|
| 26 | for (const managedPath of this.managedPaths) {
|
---|
| 27 | compiler.managedPaths.add(managedPath);
|
---|
| 28 | }
|
---|
| 29 | for (const immutablePath of this.immutablePaths) {
|
---|
| 30 | compiler.immutablePaths.add(immutablePath);
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | module.exports = AddManagedPathsPlugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.