Add css/less/scss plugin

This commit is contained in:
Martin Aeschlimann 2016-06-23 12:06:21 +02:00
parent 500e5616c6
commit b83bf844f2
3 changed files with 15 additions and 7 deletions

View file

@ -25,19 +25,20 @@
<script src="../metadata.js"></script>
<script>
var RUN_EDITOR_FROM_SOURCE = false; // should run the editor from source? (or from the node module)
var RUN_PLUGINS_FROM_SOURCE = {}; // should run the editor plugins from source? (or from node modules)
RUN_PLUGINS_FROM_SOURCE['monaco-typescript'] = false;
RUN_PLUGINS_FROM_SOURCE['monaco-languages'] = false;
function getQueryStringValue (key) {
return unescape(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + escape(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
// Resolve paths
if (RUN_EDITOR_FROM_SOURCE) {
// should run the editor and/or plugins from source? (or from the node module)
if (getQueryStringValue('editor') === 'dev') {
METADATA.CORE.path = METADATA.CORE.srcPath;
} else {
METADATA.CORE.path = '/monaco-editor/' + METADATA.CORE.path;
}
METADATA.PLUGINS.forEach(function(plugin) {
if (RUN_PLUGINS_FROM_SOURCE[plugin.name]) {
// should run the editor plugins from source? (or from node modules)
if (plugin.srcPath && getQueryStringValue(plugin.name) === 'dev') {
plugin.path = plugin.srcPath;
} else {
plugin.path = '/monaco-editor/' + plugin.path;