修复 jssdk 改成内部模块化加载器后的报错
This commit is contained in:
parent
2724063947
commit
65dc92ff92
|
@ -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