|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
839 bytes
|
| 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 | const PLUGIN_NAME = "AddBuildDependenciesPlugin";
|
|---|
| 11 |
|
|---|
| 12 | class AddBuildDependenciesPlugin {
|
|---|
| 13 | /**
|
|---|
| 14 | * Creates an instance of AddBuildDependenciesPlugin.
|
|---|
| 15 | * @param {Iterable<string>} buildDependencies list of build dependencies
|
|---|
| 16 | */
|
|---|
| 17 | constructor(buildDependencies) {
|
|---|
| 18 | this.buildDependencies = new Set(buildDependencies);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | /**
|
|---|
| 22 | * Applies the plugin by registering its hooks on the compiler.
|
|---|
| 23 | * @param {Compiler} compiler the compiler instance
|
|---|
| 24 | * @returns {void}
|
|---|
| 25 | */
|
|---|
| 26 | apply(compiler) {
|
|---|
| 27 | compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|---|
| 28 | compilation.buildDependencies.addAll(this.buildDependencies);
|
|---|
| 29 | });
|
|---|
| 30 | }
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | module.exports = AddBuildDependenciesPlugin;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.