UNPKG

@gdjiami/cli

Version:

CLI for build front end project.

26 lines (25 loc) 978 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var NAME = 'HtmlInjectedEnvrioments'; var HtmlInjectedDllReferences = /** @class */ (function () { function HtmlInjectedDllReferences(name) { this.name = name; } HtmlInjectedDllReferences.prototype.apply = function (compiler) { var _this = this; compiler.hooks.compilation.tap(NAME, function (compilation) { require('html-webpack-plugin') .getHooks(compilation) .alterAssetTagGroups.tapAsync(NAME, function (data, cb) { // inject enviroments data.headTags.push({ tagName: 'script', attributes: { 'data-dll': true, src: "./" + _this.name + ".js" }, }); cb(null, data); }); }); }; return HtmlInjectedDllReferences; }()); exports.default = HtmlInjectedDllReferences;