解决 sdk 版本, monaco-editor 的 worker 文件加载失败的问题。 (#1078)

This commit is contained in:
liaoxuezhi 2020-11-17 17:15:17 +08:00 committed by GitHub
parent 12be84bd61
commit 89bf27e244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -220,8 +220,8 @@ function onLoad(req: any, callback: (result: any) => void) {
baseUrl: '${config.paths.vs}',
paths: ${JSON.stringify(config.paths)}
};
importScripts('${__uri(
'monaco-editor/min/vs/base/worker/workerMain.js'
importScripts('${filterUrl(
__uri('monaco-editor/min/vs/base/worker/workerMain.js')
)}');`)}`;
}
};

View File

@ -439,6 +439,10 @@ if (fis.project.currentMedia() === 'publish') {
optimizer: null
});
env.match('monaco-editor/**.css', {
standard: false
});
fis.on('compile:optimizer', function (file) {
if (file.isJsLike && file.isMod) {
var contents = file.getContent();

View File

@ -132,6 +132,7 @@ module.exports = function (ret, pack, settings, opt) {
} catch (e) {
d = (/((?:https?|file)\:.*)$/.test(e.stack) ? RegExp.$1 : '').replace(/\\/[^\\/]*$/, '');
}
amis.host = d;
${contents.replace(/\"url\"\s*\:\s*('|")(\.\/.*)\1/g, function (
_,
quote,
@ -141,7 +142,6 @@ module.exports = function (ret, pack, settings, opt) {
})}
})()`;
}
jsContents += contents + ';\n';
}
} else if (