mp-lens
Version:
微信小程序分析工具 (Unused Code, Dependencies, Visualization)
21 lines • 609 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeWxmlImportPath = normalizeWxmlImportPath;
/**
* 标准化 WXML import/include 路径
* - 以 /、./、../ 开头的保持不变
* - 其它加上 ./
* - 绝对 URL/data/template 变量不处理
*/
function normalizeWxmlImportPath(raw) {
if (!raw ||
raw.startsWith('/') ||
raw.startsWith('./') ||
raw.startsWith('../') ||
/^(http|https|data):/.test(raw) ||
/{{.*?}}/.test(raw)) {
return raw;
}
return './' + raw;
}
//# sourceMappingURL=wxml-path.js.map