Fixing 'DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead' causing production build fail
This commit is contained in:
parent
f754feae72
commit
c0c12982de
4 changed files with 254 additions and 254 deletions
502
dist/WebpackAutoInjectVersion.js
vendored
502
dist/WebpackAutoInjectVersion.js
vendored
|
@ -1040,28 +1040,28 @@ module.exports = isTypedArray;
|
||||||
/* 35 */
|
/* 35 */
|
||||||
/***/ (function(module, exports) {
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
module.exports = function(module) {
|
module.exports = function(module) {
|
||||||
if(!module.webpackPolyfill) {
|
if(!module.webpackPolyfill) {
|
||||||
module.deprecate = function() {};
|
module.deprecate = function() {};
|
||||||
module.paths = [];
|
module.paths = [];
|
||||||
// module.parent = undefined by default
|
// module.parent = undefined by default
|
||||||
if(!module.children) module.children = [];
|
if(!module.children) module.children = [];
|
||||||
Object.defineProperty(module, "loaded", {
|
Object.defineProperty(module, "loaded", {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
get: function() {
|
get: function() {
|
||||||
return module.l;
|
return module.l;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.defineProperty(module, "id", {
|
Object.defineProperty(module, "id", {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
get: function() {
|
get: function() {
|
||||||
return module.i;
|
return module.i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
module.webpackPolyfill = 1;
|
module.webpackPolyfill = 1;
|
||||||
}
|
}
|
||||||
return module;
|
return module;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -1959,233 +1959,233 @@ module.exports = function (key) {
|
||||||
/* 74 */
|
/* 74 */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
var __WEBPACK_AMD_DEFINE_RESULT__;/*
|
var __WEBPACK_AMD_DEFINE_RESULT__;/*
|
||||||
* Date Format 1.2.3
|
* Date Format 1.2.3
|
||||||
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
||||||
* MIT license
|
* MIT license
|
||||||
*
|
*
|
||||||
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
||||||
* and Kris Kowal <cixar.com/~kris.kowal/>
|
* and Kris Kowal <cixar.com/~kris.kowal/>
|
||||||
*
|
*
|
||||||
* Accepts a date, a mask, or a date and a mask.
|
* Accepts a date, a mask, or a date and a mask.
|
||||||
* Returns a formatted version of the given date.
|
* Returns a formatted version of the given date.
|
||||||
* The date defaults to the current date/time.
|
* The date defaults to the current date/time.
|
||||||
* The mask defaults to dateFormat.masks.default.
|
* The mask defaults to dateFormat.masks.default.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(global) {
|
(function(global) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var dateFormat = (function() {
|
var dateFormat = (function() {
|
||||||
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
|
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
|
||||||
var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
|
var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
|
||||||
var timezoneClip = /[^-+\dA-Z]/g;
|
var timezoneClip = /[^-+\dA-Z]/g;
|
||||||
|
|
||||||
// Regexes and supporting functions are cached through closure
|
// Regexes and supporting functions are cached through closure
|
||||||
return function (date, mask, utc, gmt) {
|
return function (date, mask, utc, gmt) {
|
||||||
|
|
||||||
// You can't provide utc if you skip other args (use the 'UTC:' mask prefix)
|
// You can't provide utc if you skip other args (use the 'UTC:' mask prefix)
|
||||||
if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) {
|
if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) {
|
||||||
mask = date;
|
mask = date;
|
||||||
date = undefined;
|
date = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
date = date || new Date;
|
date = date || new Date;
|
||||||
|
|
||||||
if(!(date instanceof Date)) {
|
if(!(date instanceof Date)) {
|
||||||
date = new Date(date);
|
date = new Date(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(date)) {
|
if (isNaN(date)) {
|
||||||
throw TypeError('Invalid date');
|
throw TypeError('Invalid date');
|
||||||
}
|
}
|
||||||
|
|
||||||
mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']);
|
mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']);
|
||||||
|
|
||||||
// Allow setting the utc/gmt argument via the mask
|
// Allow setting the utc/gmt argument via the mask
|
||||||
var maskSlice = mask.slice(0, 4);
|
var maskSlice = mask.slice(0, 4);
|
||||||
if (maskSlice === 'UTC:' || maskSlice === 'GMT:') {
|
if (maskSlice === 'UTC:' || maskSlice === 'GMT:') {
|
||||||
mask = mask.slice(4);
|
mask = mask.slice(4);
|
||||||
utc = true;
|
utc = true;
|
||||||
if (maskSlice === 'GMT:') {
|
if (maskSlice === 'GMT:') {
|
||||||
gmt = true;
|
gmt = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = utc ? 'getUTC' : 'get';
|
var _ = utc ? 'getUTC' : 'get';
|
||||||
var d = date[_ + 'Date']();
|
var d = date[_ + 'Date']();
|
||||||
var D = date[_ + 'Day']();
|
var D = date[_ + 'Day']();
|
||||||
var m = date[_ + 'Month']();
|
var m = date[_ + 'Month']();
|
||||||
var y = date[_ + 'FullYear']();
|
var y = date[_ + 'FullYear']();
|
||||||
var H = date[_ + 'Hours']();
|
var H = date[_ + 'Hours']();
|
||||||
var M = date[_ + 'Minutes']();
|
var M = date[_ + 'Minutes']();
|
||||||
var s = date[_ + 'Seconds']();
|
var s = date[_ + 'Seconds']();
|
||||||
var L = date[_ + 'Milliseconds']();
|
var L = date[_ + 'Milliseconds']();
|
||||||
var o = utc ? 0 : date.getTimezoneOffset();
|
var o = utc ? 0 : date.getTimezoneOffset();
|
||||||
var W = getWeek(date);
|
var W = getWeek(date);
|
||||||
var N = getDayOfWeek(date);
|
var N = getDayOfWeek(date);
|
||||||
var flags = {
|
var flags = {
|
||||||
d: d,
|
d: d,
|
||||||
dd: pad(d),
|
dd: pad(d),
|
||||||
ddd: dateFormat.i18n.dayNames[D],
|
ddd: dateFormat.i18n.dayNames[D],
|
||||||
dddd: dateFormat.i18n.dayNames[D + 7],
|
dddd: dateFormat.i18n.dayNames[D + 7],
|
||||||
m: m + 1,
|
m: m + 1,
|
||||||
mm: pad(m + 1),
|
mm: pad(m + 1),
|
||||||
mmm: dateFormat.i18n.monthNames[m],
|
mmm: dateFormat.i18n.monthNames[m],
|
||||||
mmmm: dateFormat.i18n.monthNames[m + 12],
|
mmmm: dateFormat.i18n.monthNames[m + 12],
|
||||||
yy: String(y).slice(2),
|
yy: String(y).slice(2),
|
||||||
yyyy: y,
|
yyyy: y,
|
||||||
h: H % 12 || 12,
|
h: H % 12 || 12,
|
||||||
hh: pad(H % 12 || 12),
|
hh: pad(H % 12 || 12),
|
||||||
H: H,
|
H: H,
|
||||||
HH: pad(H),
|
HH: pad(H),
|
||||||
M: M,
|
M: M,
|
||||||
MM: pad(M),
|
MM: pad(M),
|
||||||
s: s,
|
s: s,
|
||||||
ss: pad(s),
|
ss: pad(s),
|
||||||
l: pad(L, 3),
|
l: pad(L, 3),
|
||||||
L: pad(Math.round(L / 10)),
|
L: pad(Math.round(L / 10)),
|
||||||
t: H < 12 ? 'a' : 'p',
|
t: H < 12 ? 'a' : 'p',
|
||||||
tt: H < 12 ? 'am' : 'pm',
|
tt: H < 12 ? 'am' : 'pm',
|
||||||
T: H < 12 ? 'A' : 'P',
|
T: H < 12 ? 'A' : 'P',
|
||||||
TT: H < 12 ? 'AM' : 'PM',
|
TT: H < 12 ? 'AM' : 'PM',
|
||||||
Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''),
|
Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''),
|
||||||
o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
||||||
S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
|
S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
|
||||||
W: W,
|
W: W,
|
||||||
N: N
|
N: N
|
||||||
};
|
};
|
||||||
|
|
||||||
return mask.replace(token, function (match) {
|
return mask.replace(token, function (match) {
|
||||||
if (match in flags) {
|
if (match in flags) {
|
||||||
return flags[match];
|
return flags[match];
|
||||||
}
|
}
|
||||||
return match.slice(1, match.length - 1);
|
return match.slice(1, match.length - 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
dateFormat.masks = {
|
dateFormat.masks = {
|
||||||
'default': 'ddd mmm dd yyyy HH:MM:ss',
|
'default': 'ddd mmm dd yyyy HH:MM:ss',
|
||||||
'shortDate': 'm/d/yy',
|
'shortDate': 'm/d/yy',
|
||||||
'mediumDate': 'mmm d, yyyy',
|
'mediumDate': 'mmm d, yyyy',
|
||||||
'longDate': 'mmmm d, yyyy',
|
'longDate': 'mmmm d, yyyy',
|
||||||
'fullDate': 'dddd, mmmm d, yyyy',
|
'fullDate': 'dddd, mmmm d, yyyy',
|
||||||
'shortTime': 'h:MM TT',
|
'shortTime': 'h:MM TT',
|
||||||
'mediumTime': 'h:MM:ss TT',
|
'mediumTime': 'h:MM:ss TT',
|
||||||
'longTime': 'h:MM:ss TT Z',
|
'longTime': 'h:MM:ss TT Z',
|
||||||
'isoDate': 'yyyy-mm-dd',
|
'isoDate': 'yyyy-mm-dd',
|
||||||
'isoTime': 'HH:MM:ss',
|
'isoTime': 'HH:MM:ss',
|
||||||
'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso',
|
'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso',
|
||||||
'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'',
|
'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'',
|
||||||
'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z'
|
'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z'
|
||||||
};
|
};
|
||||||
|
|
||||||
// Internationalization strings
|
// Internationalization strings
|
||||||
dateFormat.i18n = {
|
dateFormat.i18n = {
|
||||||
dayNames: [
|
dayNames: [
|
||||||
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
|
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
|
||||||
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
||||||
],
|
],
|
||||||
monthNames: [
|
monthNames: [
|
||||||
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
|
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
|
||||||
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
|
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
function pad(val, len) {
|
function pad(val, len) {
|
||||||
val = String(val);
|
val = String(val);
|
||||||
len = len || 2;
|
len = len || 2;
|
||||||
while (val.length < len) {
|
while (val.length < len) {
|
||||||
val = '0' + val;
|
val = '0' + val;
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ISO 8601 week number
|
* Get the ISO 8601 week number
|
||||||
* Based on comments from
|
* Based on comments from
|
||||||
* http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html
|
* http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html
|
||||||
*
|
*
|
||||||
* @param {Object} `date`
|
* @param {Object} `date`
|
||||||
* @return {Number}
|
* @return {Number}
|
||||||
*/
|
*/
|
||||||
function getWeek(date) {
|
function getWeek(date) {
|
||||||
// Remove time components of date
|
// Remove time components of date
|
||||||
var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||||
|
|
||||||
// Change date to Thursday same week
|
// Change date to Thursday same week
|
||||||
targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3);
|
targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3);
|
||||||
|
|
||||||
// Take January 4th as it is always in week 1 (see ISO 8601)
|
// Take January 4th as it is always in week 1 (see ISO 8601)
|
||||||
var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
|
var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
|
||||||
|
|
||||||
// Change date to Thursday same week
|
// Change date to Thursday same week
|
||||||
firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3);
|
firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3);
|
||||||
|
|
||||||
// Check if daylight-saving-time-switch occurred and correct for it
|
// Check if daylight-saving-time-switch occurred and correct for it
|
||||||
var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
|
var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
|
||||||
targetThursday.setHours(targetThursday.getHours() - ds);
|
targetThursday.setHours(targetThursday.getHours() - ds);
|
||||||
|
|
||||||
// Number of weeks between target Thursday and first Thursday
|
// Number of weeks between target Thursday and first Thursday
|
||||||
var weekDiff = (targetThursday - firstThursday) / (86400000*7);
|
var weekDiff = (targetThursday - firstThursday) / (86400000*7);
|
||||||
return 1 + Math.floor(weekDiff);
|
return 1 + Math.floor(weekDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ISO-8601 numeric representation of the day of the week
|
* Get ISO-8601 numeric representation of the day of the week
|
||||||
* 1 (for Monday) through 7 (for Sunday)
|
* 1 (for Monday) through 7 (for Sunday)
|
||||||
*
|
*
|
||||||
* @param {Object} `date`
|
* @param {Object} `date`
|
||||||
* @return {Number}
|
* @return {Number}
|
||||||
*/
|
*/
|
||||||
function getDayOfWeek(date) {
|
function getDayOfWeek(date) {
|
||||||
var dow = date.getDay();
|
var dow = date.getDay();
|
||||||
if(dow === 0) {
|
if(dow === 0) {
|
||||||
dow = 7;
|
dow = 7;
|
||||||
}
|
}
|
||||||
return dow;
|
return dow;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kind-of shortcut
|
* kind-of shortcut
|
||||||
* @param {*} val
|
* @param {*} val
|
||||||
* @return {String}
|
* @return {String}
|
||||||
*/
|
*/
|
||||||
function kindOf(val) {
|
function kindOf(val) {
|
||||||
if (val === null) {
|
if (val === null) {
|
||||||
return 'null';
|
return 'null';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val === undefined) {
|
if (val === undefined) {
|
||||||
return 'undefined';
|
return 'undefined';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof val !== 'object') {
|
if (typeof val !== 'object') {
|
||||||
return typeof val;
|
return typeof val;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
return 'array';
|
return 'array';
|
||||||
}
|
}
|
||||||
|
|
||||||
return {}.toString.call(val)
|
return {}.toString.call(val)
|
||||||
.slice(8, -1).toLowerCase();
|
.slice(8, -1).toLowerCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
|
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
|
||||||
return dateFormat;
|
return dateFormat;
|
||||||
}.call(exports, __webpack_require__, exports, module),
|
}.call(exports, __webpack_require__, exports, module),
|
||||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||||
} else if (typeof exports === 'object') {
|
} else if (typeof exports === 'object') {
|
||||||
module.exports = dateFormat;
|
module.exports = dateFormat;
|
||||||
} else {
|
} else {
|
||||||
global.dateFormat = dateFormat;
|
global.dateFormat = dateFormat;
|
||||||
}
|
}
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -3066,7 +3066,7 @@ var AutoIncreaseVersion = function () {
|
||||||
// we have to register AutoIncreaseVersion instead of firing it straight away
|
// we have to register AutoIncreaseVersion instead of firing it straight away
|
||||||
if (_config2.default.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
|
if (_config2.default.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
|
||||||
if (this.context.compiler) {
|
if (this.context.compiler) {
|
||||||
this.context.compiler.plugin('emit', function (compilation, cb) {
|
this.context.compiler.hooks.emit.tapAsync('EmitAutoIncreaseVersion', function (compilation, cb) {
|
||||||
_this.start();
|
_this.start();
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
|
@ -3276,7 +3276,7 @@ var InjectAsComment = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
// bind into emit hook
|
// bind into emit hook
|
||||||
this.context.compiler.plugin('emit', function (compilation, cb) {
|
this.context.compiler.hooks.emit.tapAsync('EmitInjectAsComment', function (compilation, cb) {
|
||||||
// iterate over all assets file in compilation
|
// iterate over all assets file in compilation
|
||||||
for (var basename in compilation.assets) {
|
for (var basename in compilation.assets) {
|
||||||
// bug fix, extname is not able to handle chunk file params index.js?random123
|
// bug fix, extname is not able to handle chunk file params index.js?random123
|
||||||
|
@ -3508,7 +3508,7 @@ var InjectByTag = function () {
|
||||||
value: function apply() {
|
value: function apply() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
this.context.compiler.plugin('emit', function (compilation, cb) {
|
this.context.compiler.hooks.emit.tapAsync('EmitInjectByTag', function (compilation, cb) {
|
||||||
// for every output file
|
// for every output file
|
||||||
for (var basename in compilation.assets) {
|
for (var basename in compilation.assets) {
|
||||||
// only if match regex
|
// only if match regex
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default class AutoIncreaseVersion {
|
||||||
// we have to register AutoIncreaseVersion instead of firing it straight away
|
// we have to register AutoIncreaseVersion instead of firing it straight away
|
||||||
if (config.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
|
if (config.componentsOptions.AutoIncreaseVersion.runInWatchMode) {
|
||||||
if (this.context.compiler) {
|
if (this.context.compiler) {
|
||||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
this.context.compiler.hooks.emit.tapAsync('EmitAutoIncreaseVersion', (compilation, cb) => {
|
||||||
this.start();
|
this.start();
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default class InjectAsComment {
|
||||||
*/
|
*/
|
||||||
apply() {
|
apply() {
|
||||||
// bind into emit hook
|
// bind into emit hook
|
||||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
this.context.compiler.hooks.emit.tapAsync('EmitInjectAsComment', (compilation, cb) => {
|
||||||
// iterate over all assets file in compilation
|
// iterate over all assets file in compilation
|
||||||
for (const basename in compilation.assets) {
|
for (const basename in compilation.assets) {
|
||||||
// bug fix, extname is not able to handle chunk file params index.js?random123
|
// bug fix, extname is not able to handle chunk file params index.js?random123
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class InjectByTag {
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
apply() {
|
apply() {
|
||||||
this.context.compiler.plugin('emit', (compilation, cb) => {
|
this.context.compiler.hooks.emit.tapAsync('EmitInjectByTag', (compilation, cb) => {
|
||||||
// for every output file
|
// for every output file
|
||||||
for (const basename in compilation.assets) {
|
for (const basename in compilation.assets) {
|
||||||
// only if match regex
|
// only if match regex
|
||||||
|
|
Loading…
Reference in a new issue