Vinh Le 2019-04-04 11:30:30 +07:00
commit a96400be0a
3 changed files with 6 additions and 6 deletions

View file

@ -6276,7 +6276,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();
}); });
@ -6486,7 +6486,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
@ -6611,9 +6611,9 @@ var InjectAsComment = function () {
value: function injectIntoJs(asset) { value: function injectIntoJs(asset) {
var modAsset = void 0; var modAsset = void 0;
if (this.context.config.componentsOptions.InjectAsComment.multiLineCommentType) { if (this.context.config.componentsOptions.InjectAsComment.multiLineCommentType) {
modAsset = this.parseTags('/** ' + _config2.default.SHORT, '*/'); modAsset = this.parseTags('/** ' + _config2.default.SHORT + ' ', '*/');
} else { } else {
modAsset = this.parseTags('// ' + _config2.default.SHORT, ''); modAsset = this.parseTags('// ' + _config2.default.SHORT + ' ', '');
} }
modAsset += '' + endOfLine + asset.source() + ' '; modAsset += '' + endOfLine + asset.source() + ' ';
asset.source = function () { asset.source = function () {

View file

@ -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();
}); });

View file

@ -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