Optimize Import

This commit is contained in:
MengYX
2020-02-11 14:48:27 +08:00
parent 41a45176be
commit 10f09958c4
8 changed files with 33 additions and 50 deletions

View File

@@ -27,10 +27,10 @@
},
mounted() {
if (document.location.host !== "" && process.env.NODE_ENV === 'production') {
//todo: Fail on Hot Reload
const worker = require("workerize-loader!../decrypt/common");
this.thread_num = navigator.hardwareConcurrency || 1;
for (let i = 0; i < this.thread_num; i++) {
//todo: Optimize for first loading
// noinspection JSValidateTypes,JSUnresolvedVariable
this.workers.push(worker().CommonDecrypt);
this.idle_workers.push(i);