Optimize Bundle Size

This commit is contained in:
MengYX 2020-02-06 14:05:46 +08:00
parent 05cdd7b896
commit e3ca175258
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604
5 changed files with 204 additions and 64 deletions

View File

@ -1,5 +1,16 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/cli-plugin-babel/preset' '@vue/cli-plugin-babel/preset',
["@babel/preset-env", {
"useBuiltIns": "entry",
"corejs": 3,
"modules": false
}]
],
plugins: [
["component", {
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}]
] ]
} };

234
package-lock.json generated
View File

@ -14,28 +14,70 @@
} }
}, },
"@babel/compat-data": { "@babel/compat-data": {
"version": "7.8.1", "version": "7.8.5",
"resolved": "https://registry.npm.taobao.org/@babel/compat-data/download/@babel/compat-data-7.8.1.tgz", "resolved": "https://registry.npm.taobao.org/@babel/compat-data/download/@babel/compat-data-7.8.5.tgz?cache=0&sync_timestamp=1580497169646&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcompat-data%2Fdownload%2F%40babel%2Fcompat-data-7.8.5.tgz",
"integrity": "sha1-/Au7t5keT7K0fhaOYPLMLEFoC+k=", "integrity": "sha1-0ozocneMI1Ucu5Qy/GjShJW2E7k=",
"dev": true, "dev": true,
"requires": { "requires": {
"browserslist": "^4.8.2", "browserslist": "^4.8.5",
"invariant": "^2.2.4", "invariant": "^2.2.4",
"semver": "^5.5.0" "semver": "^5.5.0"
},
"dependencies": {
"browserslist": {
"version": "4.8.6",
"resolved": "https://registry.npm.taobao.org/browserslist/download/browserslist-4.8.6.tgz",
"integrity": "sha1-lkBvP18HVdJy4npm9BY8qCFZCn4=",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001023",
"electron-to-chromium": "^1.3.341",
"node-releases": "^1.1.47"
}
},
"caniuse-lite": {
"version": "1.0.30001025",
"resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001025.tgz?cache=0&sync_timestamp=1580798021168&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001025.tgz",
"integrity": "sha1-MDNqisp/mGGOs88441GE4T1OX+Y=",
"dev": true
},
"electron-to-chromium": {
"version": "1.3.345",
"resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.345.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.345.tgz",
"integrity": "sha1-JWnQ1Upk7w8ypLfoyAr6X+V8XZg=",
"dev": true
},
"node-releases": {
"version": "1.1.47",
"resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.47.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.47.tgz",
"integrity": "sha1-xZ73OaH9fsvZ8LfPW3hx6Ki1keQ=",
"dev": true,
"requires": {
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1580434257623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true
}
}
}
} }
}, },
"@babel/core": { "@babel/core": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.8.4.tgz?cache=0&sync_timestamp=1580387817329&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcore%2Fdownload%2F%40babel%2Fcore-7.8.4.tgz",
"integrity": "sha1-MLDrtN0Vhd5pI6C00XngufXYKUE=", "integrity": "sha1-1JZ5nlwSGVs2AtD93XcpTj446A4=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.8.3", "@babel/code-frame": "^7.8.3",
"@babel/generator": "^7.8.3", "@babel/generator": "^7.8.4",
"@babel/helpers": "^7.8.3", "@babel/helpers": "^7.8.4",
"@babel/parser": "^7.8.3", "@babel/parser": "^7.8.4",
"@babel/template": "^7.8.3", "@babel/template": "^7.8.3",
"@babel/traverse": "^7.8.3", "@babel/traverse": "^7.8.4",
"@babel/types": "^7.8.3", "@babel/types": "^7.8.3",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
@ -48,9 +90,9 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.8.4.tgz?cache=0&sync_timestamp=1580387848805&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fgenerator%2Fdownload%2F%40babel%2Fgenerator-7.8.4.tgz",
"integrity": "sha1-DiLABbCpTBx06v4Z73jOU6TUXAM=", "integrity": "sha1-NbvHRIaVb+QlGCn59sSDMOjQmF4=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.8.3", "@babel/types": "^7.8.3",
@ -90,16 +132,58 @@
} }
}, },
"@babel/helper-compilation-targets": { "@babel/helper-compilation-targets": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/helper-compilation-targets/download/@babel/helper-compilation-targets-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/helper-compilation-targets/download/@babel/helper-compilation-targets-7.8.4.tgz?cache=0&sync_timestamp=1580388006542&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-compilation-targets%2Fdownload%2F%40babel%2Fhelper-compilation-targets-7.8.4.tgz",
"integrity": "sha1-Le7cgW/UHcpzVe85/UDJ6mnwcZo=", "integrity": "sha1-A9fs1FS36+GaJU92YX5hdwrtLIg=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/compat-data": "^7.8.1", "@babel/compat-data": "^7.8.4",
"browserslist": "^4.8.2", "browserslist": "^4.8.5",
"invariant": "^2.2.4", "invariant": "^2.2.4",
"levenary": "^1.1.0", "levenary": "^1.1.1",
"semver": "^5.5.0" "semver": "^5.5.0"
},
"dependencies": {
"browserslist": {
"version": "4.8.6",
"resolved": "https://registry.npm.taobao.org/browserslist/download/browserslist-4.8.6.tgz",
"integrity": "sha1-lkBvP18HVdJy4npm9BY8qCFZCn4=",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001023",
"electron-to-chromium": "^1.3.341",
"node-releases": "^1.1.47"
}
},
"caniuse-lite": {
"version": "1.0.30001025",
"resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001025.tgz?cache=0&sync_timestamp=1580798021168&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001025.tgz",
"integrity": "sha1-MDNqisp/mGGOs88441GE4T1OX+Y=",
"dev": true
},
"electron-to-chromium": {
"version": "1.3.345",
"resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.345.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.345.tgz",
"integrity": "sha1-JWnQ1Upk7w8ypLfoyAr6X+V8XZg=",
"dev": true
},
"node-releases": {
"version": "1.1.47",
"resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.47.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.47.tgz",
"integrity": "sha1-xZ73OaH9fsvZ8LfPW3hx6Ki1keQ=",
"dev": true,
"requires": {
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1580434257623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true
}
}
}
} }
}, },
"@babel/helper-create-class-features-plugin": { "@babel/helper-create-class-features-plugin": {
@ -289,13 +373,13 @@
} }
}, },
"@babel/helpers": { "@babel/helpers": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.8.3.tgz?cache=0&sync_timestamp=1578951723636&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelpers%2Fdownload%2F%40babel%2Fhelpers-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.8.4.tgz?cache=0&sync_timestamp=1580388006568&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelpers%2Fdownload%2F%40babel%2Fhelpers-7.8.4.tgz",
"integrity": "sha1-OC+7A4LOfEzpBZRauWQdaIM2zoU=", "integrity": "sha1-dU6z7nJ8Fl4KJA1sIH3nxFXzb3M=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/template": "^7.8.3", "@babel/template": "^7.8.3",
"@babel/traverse": "^7.8.3", "@babel/traverse": "^7.8.4",
"@babel/types": "^7.8.3" "@babel/types": "^7.8.3"
} }
}, },
@ -311,9 +395,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.4.tgz?cache=0&sync_timestamp=1580387974017&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fparser%2Fdownload%2F%40babel%2Fparser-7.8.4.tgz",
"integrity": "sha1-eQh0CR0gAcm+bsQmwu7Ue8dnkIE=", "integrity": "sha1-0dvmRpHWA1ipdClfpT2gdN0s6Og=",
"dev": true "dev": true
}, },
"@babel/plugin-proposal-async-generator-functions": { "@babel/plugin-proposal-async-generator-functions": {
@ -611,9 +695,9 @@
} }
}, },
"@babel/plugin-transform-for-of": { "@babel/plugin-transform-for-of": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-for-of/download/@babel/plugin-transform-for-of-7.8.3.tgz?cache=0&sync_timestamp=1578951936196&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-for-of%2Fdownload%2F%40babel%2Fplugin-transform-for-of-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-for-of/download/@babel/plugin-transform-for-of-7.8.4.tgz?cache=0&sync_timestamp=1580387848578&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-for-of%2Fdownload%2F%40babel%2Fplugin-transform-for-of-7.8.4.tgz",
"integrity": "sha1-FfF7zi/JXH1ZokspnoPoHO3CLhg=", "integrity": "sha1-b+jq5daHUIbuGF3QsJioUTeDtH0=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.8.3" "@babel/helper-plugin-utils": "^7.8.3"
@ -721,9 +805,9 @@
} }
}, },
"@babel/plugin-transform-parameters": { "@babel/plugin-transform-parameters": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-parameters/download/@babel/plugin-transform-parameters-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-parameters/download/@babel/plugin-transform-parameters-7.8.4.tgz?cache=0&sync_timestamp=1580387848572&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-parameters%2Fdownload%2F%40babel%2Fplugin-transform-parameters-7.8.4.tgz",
"integrity": "sha1-eJBXahOxcyXYt9RMs38h3Du92lk=", "integrity": "sha1-HVFV3gtl2wzPmXEWV0XTu5kNd9M=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-call-delegate": "^7.8.3", "@babel/helper-call-delegate": "^7.8.3",
@ -809,9 +893,9 @@
} }
}, },
"@babel/plugin-transform-typeof-symbol": { "@babel/plugin-transform-typeof-symbol": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-typeof-symbol/download/@babel/plugin-transform-typeof-symbol-7.8.3.tgz?cache=0&sync_timestamp=1578953126454&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-typeof-symbol%2Fdownload%2F%40babel%2Fplugin-transform-typeof-symbol-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-typeof-symbol/download/@babel/plugin-transform-typeof-symbol-7.8.4.tgz",
"integrity": "sha1-XP+yFvslyMZLpr9fds5J06sHn00=", "integrity": "sha1-7eQGIxXOCq+KZXqSCFjxovNfxBI=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.8.3" "@babel/helper-plugin-utils": "^7.8.3"
@ -828,13 +912,13 @@
} }
}, },
"@babel/preset-env": { "@babel/preset-env": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/preset-env/download/@babel/preset-env-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/preset-env/download/@babel/preset-env-7.8.4.tgz?cache=0&sync_timestamp=1580388072547&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fpreset-env%2Fdownload%2F%40babel%2Fpreset-env-7.8.4.tgz",
"integrity": "sha1-3A+yk49Su93XmzyGGks0J906bFQ=", "integrity": "sha1-naxt9fQjAV09Sbbp5fo0E+SnLE4=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/compat-data": "^7.8.0", "@babel/compat-data": "^7.8.4",
"@babel/helper-compilation-targets": "^7.8.3", "@babel/helper-compilation-targets": "^7.8.4",
"@babel/helper-module-imports": "^7.8.3", "@babel/helper-module-imports": "^7.8.3",
"@babel/helper-plugin-utils": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3",
"@babel/plugin-proposal-async-generator-functions": "^7.8.3", "@babel/plugin-proposal-async-generator-functions": "^7.8.3",
@ -863,7 +947,7 @@
"@babel/plugin-transform-dotall-regex": "^7.8.3", "@babel/plugin-transform-dotall-regex": "^7.8.3",
"@babel/plugin-transform-duplicate-keys": "^7.8.3", "@babel/plugin-transform-duplicate-keys": "^7.8.3",
"@babel/plugin-transform-exponentiation-operator": "^7.8.3", "@babel/plugin-transform-exponentiation-operator": "^7.8.3",
"@babel/plugin-transform-for-of": "^7.8.3", "@babel/plugin-transform-for-of": "^7.8.4",
"@babel/plugin-transform-function-name": "^7.8.3", "@babel/plugin-transform-function-name": "^7.8.3",
"@babel/plugin-transform-literals": "^7.8.3", "@babel/plugin-transform-literals": "^7.8.3",
"@babel/plugin-transform-member-expression-literals": "^7.8.3", "@babel/plugin-transform-member-expression-literals": "^7.8.3",
@ -874,7 +958,7 @@
"@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3",
"@babel/plugin-transform-new-target": "^7.8.3", "@babel/plugin-transform-new-target": "^7.8.3",
"@babel/plugin-transform-object-super": "^7.8.3", "@babel/plugin-transform-object-super": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.8.3", "@babel/plugin-transform-parameters": "^7.8.4",
"@babel/plugin-transform-property-literals": "^7.8.3", "@babel/plugin-transform-property-literals": "^7.8.3",
"@babel/plugin-transform-regenerator": "^7.8.3", "@babel/plugin-transform-regenerator": "^7.8.3",
"@babel/plugin-transform-reserved-words": "^7.8.3", "@babel/plugin-transform-reserved-words": "^7.8.3",
@ -882,14 +966,56 @@
"@babel/plugin-transform-spread": "^7.8.3", "@babel/plugin-transform-spread": "^7.8.3",
"@babel/plugin-transform-sticky-regex": "^7.8.3", "@babel/plugin-transform-sticky-regex": "^7.8.3",
"@babel/plugin-transform-template-literals": "^7.8.3", "@babel/plugin-transform-template-literals": "^7.8.3",
"@babel/plugin-transform-typeof-symbol": "^7.8.3", "@babel/plugin-transform-typeof-symbol": "^7.8.4",
"@babel/plugin-transform-unicode-regex": "^7.8.3", "@babel/plugin-transform-unicode-regex": "^7.8.3",
"@babel/types": "^7.8.3", "@babel/types": "^7.8.3",
"browserslist": "^4.8.2", "browserslist": "^4.8.5",
"core-js-compat": "^3.6.2", "core-js-compat": "^3.6.2",
"invariant": "^2.2.2", "invariant": "^2.2.2",
"levenary": "^1.1.0", "levenary": "^1.1.1",
"semver": "^5.5.0" "semver": "^5.5.0"
},
"dependencies": {
"browserslist": {
"version": "4.8.6",
"resolved": "https://registry.npm.taobao.org/browserslist/download/browserslist-4.8.6.tgz",
"integrity": "sha1-lkBvP18HVdJy4npm9BY8qCFZCn4=",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001023",
"electron-to-chromium": "^1.3.341",
"node-releases": "^1.1.47"
}
},
"caniuse-lite": {
"version": "1.0.30001025",
"resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001025.tgz?cache=0&sync_timestamp=1580798021168&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001025.tgz",
"integrity": "sha1-MDNqisp/mGGOs88441GE4T1OX+Y=",
"dev": true
},
"electron-to-chromium": {
"version": "1.3.345",
"resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.345.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.345.tgz",
"integrity": "sha1-JWnQ1Upk7w8ypLfoyAr6X+V8XZg=",
"dev": true
},
"node-releases": {
"version": "1.1.47",
"resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.47.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.47.tgz",
"integrity": "sha1-xZ73OaH9fsvZ8LfPW3hx6Ki1keQ=",
"dev": true,
"requires": {
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1580434257623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
"dev": true
}
}
}
} }
}, },
"@babel/runtime": { "@babel/runtime": {
@ -913,16 +1039,16 @@
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.8.3", "version": "7.8.4",
"resolved": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.3.tgz?cache=0&sync_timestamp=1578951726386&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.3.tgz", "resolved": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.4.tgz?cache=0&sync_timestamp=1580387975267&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.4.tgz",
"integrity": "sha1-qCYhWwEcm09z86iTr7wFFRNYv5o=", "integrity": "sha1-8IRYIjZfnVsOMS7TlZ0/gn+Gnjw=",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.8.3", "@babel/code-frame": "^7.8.3",
"@babel/generator": "^7.8.3", "@babel/generator": "^7.8.4",
"@babel/helper-function-name": "^7.8.3", "@babel/helper-function-name": "^7.8.3",
"@babel/helper-split-export-declaration": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3",
"@babel/parser": "^7.8.3", "@babel/parser": "^7.8.4",
"@babel/types": "^7.8.3", "@babel/types": "^7.8.3",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0", "globals": "^11.1.0",
@ -6663,9 +6789,9 @@
"dev": true "dev": true
}, },
"levenary": { "levenary": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/levenary/download/levenary-1.1.0.tgz", "resolved": "https://registry.npm.taobao.org/levenary/download/levenary-1.1.1.tgz",
"integrity": "sha1-/BRv518y3Eg6Cixkrvcg9gLNYhA=", "integrity": "sha1-hCqe6Y0gdap/ru2+MmeekgX0b3c=",
"dev": true, "dev": true,
"requires": { "requires": {
"leven": "^3.1.0" "leven": "^3.1.0"

View File

@ -16,6 +16,7 @@
"vue": "^2.6.11" "vue": "^2.6.11"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.8.4",
"@vue/cli-plugin-babel": "^4.1.2", "@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-pwa": "^4.1.2", "@vue/cli-plugin-pwa": "^4.1.2",
"@vue/cli-service": "^4.1.2", "@vue/cli-service": "^4.1.2",

View File

@ -96,8 +96,6 @@
// //
"use strict"; "use strict";
const worker = require("workerize-loader!./decrypt/common");
const dec = require('./decrypt/common');
export default { export default {
name: 'app', name: 'app',
components: {}, components: {},
@ -132,12 +130,15 @@
this.finishLoad(); this.finishLoad();
}); });
if (document.location.host !== "") { if (document.location.host !== "") {
this.thread_num = Math.max(navigator.hardwareConcurrency, 1); //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++) { for (let i = 0; i < this.thread_num; i++) {
this.workers.push(worker().CommonDecrypt); this.workers.push(worker().CommonDecrypt);
this.idle_workers.push(i); this.idle_workers.push(i);
} }
} else { } else {
const dec = require('./decrypt/common');
this.workers.push(dec.CommonDecrypt); this.workers.push(dec.CommonDecrypt);
this.idle_workers.push(0) this.idle_workers.push(0)
} }

View File

@ -1,6 +1,7 @@
const musicMetadata = require("music-metadata-browser"); const musicMetadata = require("music-metadata-browser");
const util = require("./util"); const util = require("./util");
export {Decrypt} export {Decrypt}
const FLAC_HEADER = [0x66, 0x4C, 0x61, 0x43, 0x00];
async function Decrypt(file, raw_filename, raw_ext) { async function Decrypt(file, raw_filename, raw_ext) {
// 获取扩展名 // 获取扩展名
@ -45,7 +46,7 @@ async function Decrypt(file, raw_filename, raw_ext) {
} }
class Mask { class Mask {
FLAC_HEADER = [0x66, 0x4C, 0x61, 0x43, 0x00];
constructor() { constructor() {
this.index = -1; this.index = -1;
@ -69,9 +70,9 @@ class Mask {
if (!flag) continue; if (!flag) continue;
for (let test_idx = 0; test_idx < this.FLAC_HEADER.length; test_idx++) { for (let test_idx = 0; test_idx < FLAC_HEADER.length; test_idx++) {
let p = data[test_idx] ^ mask[test_idx]; let p = data[test_idx] ^ mask[test_idx];
if (p !== this.FLAC_HEADER[test_idx]) { if (p !== FLAC_HEADER[test_idx]) {
flag = false; flag = false;
debugger; debugger;
break; break;