source: trip-planner-front/node_modules/license-webpack-plugin/dist/WebpackAssetManager.js@ 1ad8e64

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

initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.WebpackAssetManager = void 0;
4var webpack_sources_1 = require("webpack-sources");
5var WebpackAssetManager = /** @class */ (function () {
6 function WebpackAssetManager(outputFilename, licensesRenderer) {
7 this.outputFilename = outputFilename;
8 this.licensesRenderer = licensesRenderer;
9 }
10 WebpackAssetManager.prototype.writeChunkLicenses = function (modules, compilation, chunk) {
11 var text = this.licensesRenderer.renderLicenses(modules);
12 if (text && text.trim()) {
13 var filename = compilation.getPath(this.outputFilename, { chunk: chunk });
14 compilation.assets[filename] = new webpack_sources_1.RawSource(text);
15 }
16 };
17 WebpackAssetManager.prototype.writeChunkBanners = function (modules, compilation, chunk) {
18 var filename = compilation.getPath(this.outputFilename, { chunk: chunk });
19 var text = this.licensesRenderer.renderBanner(filename, modules);
20 if (text && text.trim()) {
21 var files = chunk.files instanceof Set ? Array.from(chunk.files) : chunk.files;
22 files
23 .filter(function (file) { return /\.js$/.test(file); })
24 .forEach(function (file) {
25 compilation.assets[file] = new webpack_sources_1.ConcatSource(text, compilation.assets[file]);
26 });
27 }
28 };
29 WebpackAssetManager.prototype.writeAllLicenses = function (modules, compilation) {
30 var text = this.licensesRenderer.renderLicenses(modules);
31 if (text) {
32 var filename = compilation.getPath(this.outputFilename, compilation);
33 compilation.assets[filename] = new webpack_sources_1.RawSource(text);
34 }
35 };
36 return WebpackAssetManager;
37}());
38exports.WebpackAssetManager = WebpackAssetManager;
Note: See TracBrowser for help on using the repository browser.