source: trip-planner-front/node_modules/@angular-devkit/build-angular/src/webpack/plugins/remove-hash-plugin.js

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

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.RemoveHashPlugin = void 0;
11class RemoveHashPlugin {
12 constructor(options) {
13 this.options = options;
14 }
15 apply(compiler) {
16 compiler.hooks.compilation.tap('remove-hash-plugin', (compilation) => {
17 const assetPath = (path, data) => {
18 var _a;
19 const chunkName = (_a = data.chunk) === null || _a === void 0 ? void 0 : _a.name;
20 const { chunkNames, hashFormat } = this.options;
21 if (chunkName && (chunkNames === null || chunkNames === void 0 ? void 0 : chunkNames.includes(chunkName))) {
22 // Replace hash formats with empty strings.
23 return path.replace(hashFormat.chunk, '').replace(hashFormat.extract, '');
24 }
25 return path;
26 };
27 compilation.hooks.assetPath.tap('remove-hash-plugin', assetPath);
28 });
29 }
30}
31exports.RemoveHashPlugin = RemoveHashPlugin;
Note: See TracBrowser for help on using the repository browser.