mm_statics 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -553,17 +553,17 @@ Static.prototype._handleCache = async function (url, ctx) {
|
|
|
553
553
|
* @param {string} path 文件路径
|
|
554
554
|
* @returns {string|null} 编译后的内容
|
|
555
555
|
*/
|
|
556
|
-
Static.prototype._handleFileCompile = function (path) {
|
|
556
|
+
Static.prototype._handleFileCompile = async function (path) {
|
|
557
557
|
if (!path.startsWith(this.config.path)) return null;
|
|
558
558
|
|
|
559
559
|
let file_type = this._getType(path);
|
|
560
560
|
let { compile_vue, convert_amd } = this.config;
|
|
561
561
|
|
|
562
562
|
if (convert_amd && this.config.files.includes('.' + file_type)) {
|
|
563
|
-
return this._runAmd(path, file_type);
|
|
563
|
+
return await this._runAmd(path, file_type);
|
|
564
564
|
}
|
|
565
565
|
else if (compile_vue && file_type === 'vue') {
|
|
566
|
-
return this._runVue(path);
|
|
566
|
+
return await this._runVue(path);
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
return null;
|
|
@@ -602,7 +602,7 @@ Static.prototype.main = async function (ctx, next) {
|
|
|
602
602
|
}
|
|
603
603
|
|
|
604
604
|
// 处理文件编译
|
|
605
|
-
let body = this._handleFileCompile(path);
|
|
605
|
+
let body = await this._handleFileCompile(path);
|
|
606
606
|
if (body) {
|
|
607
607
|
await this._handleCompiledResp(url, path, body, ctx);
|
|
608
608
|
return;
|