fix: use factory method to create worker executor

This commit is contained in:
Valeriy
2019-01-03 01:50:28 +03:00
committed by Stuart Taylor
parent 871eacacd6
commit dcca74ab92
3 changed files with 9 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ import presetReact from '@babel/preset-react';
import protect from 'loop-protect';
import * as vinyl from '../utils/polyvinyl.js';
import WorkerExecutor from '../utils/worker-executor';
import createWorker from '../utils/worker-executor';
const protectTimeout = 100;
Babel.registerPlugin('loopProtection', protect(protectTimeout));
@@ -91,7 +91,7 @@ export const babelTransformer = cond([
[stubTrue, identity]
]);
const sassWorker = new WorkerExecutor('sass-compile');
const sassWorker = createWorker('sass-compile');
async function transformSASS(element) {
const styleTags = element.querySelectorAll('style[type="text/sass"]');
await Promise.all(