This commit is contained in:
Alexandru Dima 2020-12-24 13:51:58 +01:00
parent c5586a25cf
commit 9a7dd62fff
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
6 changed files with 13 additions and 12 deletions

View file

@ -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",

View file

@ -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'
}); });

View file

@ -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') {

View file

@ -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') {

View file

@ -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') {

View file

@ -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') {