From f12654f83f92c1328b8683e419b95086ba53250c Mon Sep 17 00:00:00 2001 From: QWp6t Date: Mon, 9 Jan 2017 13:49:38 -0800 Subject: [PATCH] images should be recompiled on compiler `done` event --- assets/build/webpack.plugin.copyglobs.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/build/webpack.plugin.copyglobs.js b/assets/build/webpack.plugin.copyglobs.js index 76202d0..09c9ccf 100644 --- a/assets/build/webpack.plugin.copyglobs.js +++ b/assets/build/webpack.plugin.copyglobs.js @@ -71,6 +71,7 @@ module.exports = class { this.globOptions.nodir = true; this.manifest = options.manifest || {}; this.files = []; + this.started = false; } apply(compiler) { if (this.disable) { @@ -78,8 +79,12 @@ module.exports = class { } this.compiler = compiler; this.resolveWorkingDirectory(); - compiler.plugin('emit', this.emitHandler.bind(this)); - compiler.plugin('after-emit', this.afterEmitHandler.bind(this)); + if (!this.started) { + compiler.plugin('emit', this.emitHandler.bind(this)); + compiler.plugin('after-emit', this.afterEmitHandler.bind(this)); + compiler.plugin('after-emit', this.afterEmitHandler.bind(this)); + this.started = true; + } } emitHandler(compilation, callback) { this.compilation = compilation;