diff --git a/examples/loadMonacoEditor.ts b/examples/loadMonacoEditor.ts index c76ae8aa8..e229cb26c 100644 --- a/examples/loadMonacoEditor.ts +++ b/examples/loadMonacoEditor.ts @@ -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') )}');`)}`; } }; diff --git a/fis-conf.js b/fis-conf.js index bfa6b9e0d..2fe89632e 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -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(); diff --git a/scripts/embed-packager.js b/scripts/embed-packager.js index d10bb3c48..5d9f5273c 100644 --- a/scripts/embed-packager.js +++ b/scripts/embed-packager.js @@ -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 (