source: trip-planner-front/node_modules/license-webpack-plugin/dist/LicenseWebpackPlugin.js@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.6 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.LicenseWebpackPlugin = void 0;
4var ChunkIncludeExcludeTester_1 = require("./ChunkIncludeExcludeTester");
5var PluginChunkReadHandler_1 = require("./PluginChunkReadHandler");
6var PluginFileHandler_1 = require("./PluginFileHandler");
7var WebpackFileSystem_1 = require("./WebpackFileSystem");
8var PluginLicenseTypeIdentifier_1 = require("./PluginLicenseTypeIdentifier");
9var LicenseTextReader_1 = require("./LicenseTextReader");
10var WebpackCompilerHandler_1 = require("./WebpackCompilerHandler");
11var PluginModuleCache_1 = require("./PluginModuleCache");
12var WebpackAssetManager_1 = require("./WebpackAssetManager");
13var PluginLicensesRenderer_1 = require("./PluginLicensesRenderer");
14var PluginLicensePolicy_1 = require("./PluginLicensePolicy");
15var PluginLicenseTestRunner_1 = require("./PluginLicenseTestRunner");
16var PluginOptionsReader_1 = require("./PluginOptionsReader");
17var Logger_1 = require("./Logger");
18var LicenseWebpackPlugin = /** @class */ (function () {
19 function LicenseWebpackPlugin(pluginOptions) {
20 if (pluginOptions === void 0) { pluginOptions = {}; }
21 this.pluginOptions = pluginOptions;
22 }
23 LicenseWebpackPlugin.prototype.apply = function (compiler) {
24 var fileSystem = new WebpackFileSystem_1.WebpackFileSystem(compiler.inputFileSystem);
25 var optionsReader = new PluginOptionsReader_1.PluginOptionsReader(compiler.context);
26 var options = optionsReader.readOptions(this.pluginOptions);
27 var logger = new Logger_1.Logger(options.stats);
28 var fileHandler = new PluginFileHandler_1.PluginFileHandler(fileSystem, options.buildRoot, options.modulesDirectories, options.excludedPackageTest);
29 var licenseTypeIdentifier = new PluginLicenseTypeIdentifier_1.PluginLicenseTypeIdentifier(logger, options.licenseTypeOverrides, options.preferredLicenseTypes, options.handleLicenseAmbiguity, options.handleMissingLicenseType);
30 var licenseTextReader = new LicenseTextReader_1.LicenseTextReader(logger, fileSystem, options.licenseFileOverrides, options.licenseTextOverrides, options.licenseTemplateDir, options.handleMissingLicenseText);
31 var licenseTestRunner = new PluginLicenseTestRunner_1.PluginLicenseTestRunner(options.licenseInclusionTest);
32 var unacceptableLicenseTestRunner = new PluginLicenseTestRunner_1.PluginLicenseTestRunner(options.unacceptableLicenseTest);
33 var policy = new PluginLicensePolicy_1.PluginLicensePolicy(licenseTestRunner, unacceptableLicenseTestRunner, options.handleUnacceptableLicense, options.handleMissingLicenseText);
34 var readHandler = new PluginChunkReadHandler_1.PluginChunkReadHandler(logger, fileHandler, licenseTypeIdentifier, licenseTextReader, policy, fileSystem);
35 var licenseRenderer = new PluginLicensesRenderer_1.PluginLicensesRenderer(options.renderLicenses, options.renderBanner);
36 var moduleCache = new PluginModuleCache_1.PluginModuleCache();
37 var assetManager = new WebpackAssetManager_1.WebpackAssetManager(options.outputFilename, licenseRenderer);
38 var chunkIncludeExcludeTester = new ChunkIncludeExcludeTester_1.ChunkIncludeExcludeTester(options.chunkIncludeExcludeTest);
39 var handler = new WebpackCompilerHandler_1.WebpackCompilerHandler(chunkIncludeExcludeTester, readHandler, assetManager, moduleCache, options.addBanner, options.perChunkOutput, options.additionalChunkModules, options.additionalModules, options.skipChildCompilers);
40 handler.handleCompiler(compiler);
41 };
42 return LicenseWebpackPlugin;
43}());
44exports.LicenseWebpackPlugin = LicenseWebpackPlugin;
Note: See TracBrowser for help on using the repository browser.