From c0339f167b8cf9f05f1077b9160a8a5bade72234 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 20 May 2019 10:33:59 -0600 Subject: [PATCH] Use mode from the loader context See https://github.com/webpack/webpack/pull/9140. --- examples/webpack/worker-loader.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/webpack/worker-loader.js b/examples/webpack/worker-loader.js index cbb7b38bf7..d03e126a32 100644 --- a/examples/webpack/worker-loader.js +++ b/examples/webpack/worker-loader.js @@ -2,14 +2,7 @@ const build = require('../../tasks/serialize-workers').build; function loader() { const callback = this.async(); - - let minify = false; - - // TODO: remove when https://github.com/webpack/webpack/issues/6496 is addressed - const compilation = this._compilation; - if (compilation) { - minify = compilation.compiler.options.mode === 'production'; - } + const minify = this.mode === 'production'; build(this.resource, {minify}) .then(chunk => {