Fixes Microsoft/monaco-editor#717: use absolute paths when running under http

pull/2748/head
Alex Dima 7 years ago
parent aed7441450
commit e87b2e9445

@ -11,11 +11,20 @@
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div>
<script>
var require = {
paths: {
'vs/language/typescript': '../out',
'vs': '../node_modules/monaco-editor-core/dev/vs'
var paths = {
'vs/language/typescript': '../out',
'vs': '../node_modules/monaco-editor-core/dev/vs'
};
if (document.location.protocol === 'http:') {
// Add support for running local http server
let testIndex = document.location.pathname.indexOf('/test/');
if (testIndex !== -1) {
let prefix = document.location.pathname.substr(0, testIndex);
paths['vs/language/typescript'] = prefix + '/out';
}
}
var require = {
paths: paths
};
</script>
<script src="../node_modules/monaco-editor-core/dev/vs/loader.js"></script>

Loading…
Cancel
Save