File size: 484 Bytes
7aec436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const realWorkerLoader = require('worker-loader');

module.exports.pitch = function inlineWorkerLoaderPitch (...args) {
  // This is a hack to always make worker-loader run inline.
  const newThis = new Proxy(this, {
    get(target, property) {
      if (property === 'query') {
        return {
          inline: true,
          fallback: false
        };
      }
      return target[property];
    }
  });
  return realWorkerLoader.pitch.call(newThis, ...args);
};