mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +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>
|
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var require = {
|
var paths = {
|
||||||
paths: {
|
'vs/language/typescript': '../out',
|
||||||
'vs/language/typescript': '../out',
|
'vs': '../node_modules/monaco-editor-core/dev/vs'
|
||||||
'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>
|
||||||
<script src="../node_modules/monaco-editor-core/dev/vs/loader.js"></script>
|
<script src="../node_modules/monaco-editor-core/dev/vs/loader.js"></script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue