fix(client): tune a worker executor
This commit is contained in:
@ -97,7 +97,7 @@ async function transformSASS(element) {
|
||||
await Promise.all(
|
||||
[].map.call(styleTags, async style => {
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = await sassWorker.execute(style.innerHTML, 2000);
|
||||
style.innerHTML = await sassWorker.execute(style.innerHTML, 5000);
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -122,14 +122,11 @@ export const composeHTML = cond([
|
||||
[
|
||||
testHTML,
|
||||
flow(
|
||||
partial(
|
||||
vinyl.transformHeadTailAndContents,
|
||||
source => {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = source;
|
||||
return div.innerHTML;
|
||||
}
|
||||
),
|
||||
partial(vinyl.transformHeadTailAndContents, source => {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = source;
|
||||
return div.innerHTML;
|
||||
}),
|
||||
partial(vinyl.compileHeadTail, '')
|
||||
)
|
||||
],
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { homeLocation } from '../../../../config/env.json';
|
||||
|
||||
export default class WorkerExecutor {
|
||||
constructor(workerName) {
|
||||
this.workerName = workerName;
|
||||
@ -11,7 +13,7 @@ export default class WorkerExecutor {
|
||||
|
||||
getWorker() {
|
||||
if (this.worker === null) {
|
||||
this.worker = new Worker(`js/${this.workerName}.js`);
|
||||
this.worker = new Worker(`${homeLocation}/js/${this.workerName}.js`);
|
||||
}
|
||||
|
||||
return this.worker;
|
||||
|
Reference in New Issue
Block a user