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