mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 09:20:10 +01:00
Fixes Microsoft/monaco-editor#717: use absolute paths when running under http
This commit is contained in:
parent
aed7441450
commit
e87b2e9445
1 changed files with 13 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue