mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
修复 jssdk 改成内部模块化加载器后的报错
This commit is contained in:
parent
2724063947
commit
65dc92ff92
@ -132,13 +132,11 @@ module.exports = function (ret, pack, settings, opt) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
d = (/((?:https?|file)\:.*)$/.test(e.stack) && RegExp.$1).replace(/\\/[^\\/]*$/, '');
|
d = (/((?:https?|file)\:.*)$/.test(e.stack) && RegExp.$1).replace(/\\/[^\\/]*$/, '');
|
||||||
}
|
}
|
||||||
${contents.replace(/\"url\"\s*\:\s*('|")(\.\/.*)\1/g, function (
|
${contents
|
||||||
_,
|
.replace(/\"url\"\s*\:\s*('|")(\.\/.*)\1/g, function (_, quote, value) {
|
||||||
quote,
|
return `"url": d + ${quote}${value.substring(1)}${quote}`;
|
||||||
value
|
})
|
||||||
) {
|
.replace(/require\.resourceMap/, 'amis.require.resourceMap')}
|
||||||
return `"url": d + ${quote}${value.substring(1)}${quote}`;
|
|
||||||
})}
|
|
||||||
})()`;
|
})()`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function amisRequire(...args: Array<any>) {
|
|||||||
let id = args.shift();
|
let id = args.shift();
|
||||||
id = Array.isArray(id) ? id.map(id => mapping[id] || id) : mapping[id] || id;
|
id = Array.isArray(id) ? id.map(id => mapping[id] || id) : mapping[id] || id;
|
||||||
args.unshift(id);
|
args.unshift(id);
|
||||||
return require.apply(this, args);
|
return amis.require.apply(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
(window as any).amisRequire = amisRequire;
|
(window as any).amisRequire = amisRequire;
|
||||||
|
Loading…
Reference in New Issue
Block a user