Use mode from the loader context
See https://github.com/webpack/webpack/pull/9140.
This commit is contained in:
@@ -2,14 +2,7 @@ const build = require('../../tasks/serialize-workers').build;
|
|||||||
|
|
||||||
function loader() {
|
function loader() {
|
||||||
const callback = this.async();
|
const callback = this.async();
|
||||||
|
const minify = this.mode === 'production';
|
||||||
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';
|
|
||||||
}
|
|
||||||
|
|
||||||
build(this.resource, {minify})
|
build(this.resource, {minify})
|
||||||
.then(chunk => {
|
.then(chunk => {
|
||||||
|
|||||||
Reference in New Issue
Block a user