mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
run prettier
This commit is contained in:
parent
107e6c27b8
commit
e56acf710a
1 changed files with 11 additions and 9 deletions
|
|
@ -12,21 +12,23 @@
|
||||||
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
|
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// Allow monaco-editor to load scripts from its own paths only
|
// Allow monaco-editor to load scripts from its own paths only
|
||||||
var scriptLoadingPolicy = {
|
var scriptLoadingPolicy = {
|
||||||
createScriptURL: function allowOnlyMonacoPaths(url) {
|
createScriptURL: function allowOnlyMonacoPaths(url) {
|
||||||
if (url.indexOf('../node_modules/monaco-editor/min/vs/') === 0 &&
|
if (
|
||||||
url.lastIndexOf('..') == 0) {
|
url.indexOf('../node_modules/monaco-editor/min/vs/') === 0 &&
|
||||||
return url;
|
url.lastIndexOf('..') == 0
|
||||||
}
|
) {
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// If browser supports Trusted Types, use them.
|
// If browser supports Trusted Types, use them.
|
||||||
if (typeof trustedTypes !== "undefined") {
|
if (typeof trustedTypes !== 'undefined') {
|
||||||
scriptLoadingPolicy = trustedTypes.createPolicy('monaco-editor', scriptLoadingPolicy);
|
scriptLoadingPolicy = trustedTypes.createPolicy('monaco-editor', scriptLoadingPolicy);
|
||||||
}
|
}
|
||||||
require.config({
|
require.config({
|
||||||
paths: { vs: '../node_modules/monaco-editor/min/vs' },
|
paths: { vs: '../node_modules/monaco-editor/min/vs' },
|
||||||
trustedTypesPolicy: scriptLoadingPolicy,
|
trustedTypesPolicy: scriptLoadingPolicy
|
||||||
});
|
});
|
||||||
|
|
||||||
require(['vs/editor/editor.main'], function () {
|
require(['vs/editor/editor.main'], function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue