浏览代码

Fix samples (microsoft/monaco-editor#2212)

Alexandru Dima 4 年之前
父节点
当前提交
9a7dd62fff

+ 1 - 1
browser-esm-parcel/package.json

@@ -2,7 +2,7 @@
 	"name": "helloworld",
 	"name": "helloworld",
 	"dependencies": {},
 	"dependencies": {},
 	"scripts": {
 	"scripts": {
-		"simpleserver": "../node_modules/.bin/yaserver --root ./dist --port 9999",
+		"simpleserver": "node ../node_modules/yaserver/bin/yaserver --root ./dist --port 9999",
 		"build": "npm run build-index && npm run build-json && npm run build-css && npm run build-html && npm run build-ts && npm run build-worker",
 		"build": "npm run build-index && npm run build-json && npm run build-css && npm run build-html && npm run build-ts && npm run build-worker",
 		"build-index": "parcel build src/index.html",
 		"build-index": "parcel build src/index.html",
 		"build-json": "parcel build ../node_modules/monaco-editor/esm/vs/language/json/json.worker.js --no-source-maps",
 		"build-json": "parcel build ../node_modules/monaco-editor/esm/vs/language/json/json.worker.js --no-source-maps",

+ 4 - 3
browser-esm-parcel/src/index.js

@@ -5,10 +5,10 @@ self.MonacoEnvironment = {
 		if (label === 'json') {
 		if (label === 'json') {
 			return './json.worker.js';
 			return './json.worker.js';
 		}
 		}
-		if (label === 'css') {
+		if (label === 'css' || label === 'scss' || label === 'less') {
 			return './css.worker.js';
 			return './css.worker.js';
 		}
 		}
-		if (label === 'html') {
+		if (label === 'html' || label === 'handlebars' || label === 'razor') {
 			return './html.worker.js';
 			return './html.worker.js';
 		}
 		}
 		if (label === 'typescript' || label === 'javascript') {
 		if (label === 'typescript' || label === 'javascript') {
@@ -20,5 +20,6 @@ self.MonacoEnvironment = {
 
 
 monaco.editor.create(document.getElementById('container'), {
 monaco.editor.create(document.getElementById('container'), {
 	value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
 	value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
-	language: 'javascript'
+	// language: 'javascript'
+	language: 'scss'
 });
 });

+ 2 - 2
browser-esm-webpack-small/index.js

@@ -133,10 +133,10 @@ self.MonacoEnvironment = {
 		// if (label === 'json') {
 		// if (label === 'json') {
 		// 	return './json.worker.bundle.js';
 		// 	return './json.worker.bundle.js';
 		// }
 		// }
-		// if (label === 'css') {
+		// if (label === 'css' || label === 'scss' || label === 'less') {
 		// 	return './css.worker.bundle.js';
 		// 	return './css.worker.bundle.js';
 		// }
 		// }
-		// if (label === 'html') {
+		// if (label === 'html' || label === 'handlebars' || label === 'razor') {
 		// 	return './html.worker.bundle.js';
 		// 	return './html.worker.bundle.js';
 		// }
 		// }
 		// if (label === 'typescript' || label === 'javascript') {
 		// if (label === 'typescript' || label === 'javascript') {

+ 2 - 2
browser-esm-webpack-typescript-react/src/components/Editor.tsx

@@ -7,10 +7,10 @@ self.MonacoEnvironment = {
 		if (label === 'json') {
 		if (label === 'json') {
 			return './json.worker.bundle.js';
 			return './json.worker.bundle.js';
 		}
 		}
-		if (label === 'css') {
+		if (label === 'css' || label === 'scss' || label === 'less') {
 			return './css.worker.bundle.js';
 			return './css.worker.bundle.js';
 		}
 		}
-		if (label === 'html') {
+		if (label === 'html' || label === 'handlebars' || label === 'razor') {
 			return './html.worker.bundle.js';
 			return './html.worker.bundle.js';
 		}
 		}
 		if (label === 'typescript' || label === 'javascript') {
 		if (label === 'typescript' || label === 'javascript') {

+ 2 - 2
browser-esm-webpack-typescript/src/index.ts

@@ -7,10 +7,10 @@ self.MonacoEnvironment = {
 		if (label === 'json') {
 		if (label === 'json') {
 			return './json.worker.bundle.js';
 			return './json.worker.bundle.js';
 		}
 		}
-		if (label === 'css') {
+		if (label === 'css' || label === 'scss' || label === 'less') {
 			return './css.worker.bundle.js';
 			return './css.worker.bundle.js';
 		}
 		}
-		if (label === 'html') {
+		if (label === 'html' || label === 'handlebars' || label === 'razor') {
 			return './html.worker.bundle.js';
 			return './html.worker.bundle.js';
 		}
 		}
 		if (label === 'typescript' || label === 'javascript') {
 		if (label === 'typescript' || label === 'javascript') {

+ 2 - 2
browser-esm-webpack/index.js

@@ -5,10 +5,10 @@ self.MonacoEnvironment = {
 		if (label === 'json') {
 		if (label === 'json') {
 			return './json.worker.bundle.js';
 			return './json.worker.bundle.js';
 		}
 		}
-		if (label === 'css') {
+		if (label === 'css' || label === 'scss' || label === 'less') {
 			return './css.worker.bundle.js';
 			return './css.worker.bundle.js';
 		}
 		}
-		if (label === 'html') {
+		if (label === 'html' || label === 'handlebars' || label === 'razor') {
 			return './html.worker.bundle.js';
 			return './html.worker.bundle.js';
 		}
 		}
 		if (label === 'typescript' || label === 'javascript') {
 		if (label === 'typescript' || label === 'javascript') {