Răsfoiți Sursa

Add css/less/scss plugin

Martin Aeschlimann 9 ani în urmă
părinte
comite
b83bf844f2
3 a modificat fișierele cu 15 adăugiri și 7 ștergeri
  1. 6 0
      metadata.js
  2. 2 1
      package.json
  3. 7 6
      test/index.html

+ 6 - 0
metadata.js

@@ -13,6 +13,12 @@
 			path: 'node_modules/monaco-typescript/release',
 			srcPath: '/monaco-typescript/out'
 		}, {
+			name: 'monaco-css',
+			contrib: 'vs/language/css/monaco.contribution',
+			modulePrefix: 'vs/language/css',
+			path: 'node_modules/monaco-css/release/min',
+			srcPath: '/monaco-css/release/dev'
+		},{
 			name: 'monaco-languages',
 			contrib: 'vs/basic-languages/src/monaco.contribution',
 			modulePrefix: 'vs/basic-languages',

+ 2 - 1
package.json

@@ -19,8 +19,9 @@
     "gulp": "^3.9.1",
     "http-server": "^0.9.0",
     "monaco-editor-core": "0.4.2",
-    "monaco-languages": "0.2.0",
+    "monaco-languages": "0.2.1",
     "monaco-typescript": "0.2.1",
+    "monaco-css": "1.0.0",
     "rimraf": "^2.5.2"
   }
 }

+ 7 - 6
test/index.html

@@ -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;