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