Minify worker in examples for a production build
This commit is contained in:
@@ -3,7 +3,15 @@ const build = require('../../tasks/serialize-workers').build;
|
|||||||
function loader() {
|
function loader() {
|
||||||
const callback = this.async();
|
const callback = this.async();
|
||||||
|
|
||||||
build(this.resource, {minify: false})
|
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})
|
||||||
.then(chunk => {
|
.then(chunk => {
|
||||||
for (const filePath in chunk.modules) {
|
for (const filePath in chunk.modules) {
|
||||||
this.addDependency(filePath);
|
this.addDependency(filePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user