Prune Monaco distribution, fix JS acting like TS in Scaffold
We don't need most of the bundled languages or localizations, so they were just taking up disk space pointlessly.
This commit is contained in:
parent
88869f43ae
commit
52e8fa8995
2 changed files with 15 additions and 2 deletions
|
@ -271,6 +271,10 @@ var Scaffold = new function () {
|
||||||
|
|
||||||
this.initCodeEditor = async function () {
|
this.initCodeEditor = async function () {
|
||||||
let monaco = _editors.codeGlobal, editor = _editors.code;
|
let monaco = _editors.codeGlobal, editor = _editors.code;
|
||||||
|
|
||||||
|
// For some reason, even if we explicitly re-set the default model's language to JavaScript,
|
||||||
|
// Monaco still treats it as TypeScript. Recreating the model manually fixes the issue.
|
||||||
|
editor.setModel(monaco.editor.createModel('', 'javascript', monaco.Uri.parse('inmemory:///translator.js')));
|
||||||
|
|
||||||
editor.updateOptions({
|
editor.updateOptions({
|
||||||
lineNumbers: num => num + _linesOfMetadata - 1,
|
lineNumbers: num => num + _linesOfMetadata - 1,
|
||||||
|
@ -2180,7 +2184,7 @@ var Scaffold = new function () {
|
||||||
severity: message.severity * 4,
|
severity: message.severity * 4,
|
||||||
source: 'ESLint',
|
source: 'ESLint',
|
||||||
tags: [
|
tags: [
|
||||||
message.ruleId
|
message.ruleId || '-'
|
||||||
]
|
]
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ const symlinkDirs = [
|
||||||
'chrome/content/zotero/xpcom/translate/src',
|
'chrome/content/zotero/xpcom/translate/src',
|
||||||
'styles',
|
'styles',
|
||||||
'translators',
|
'translators',
|
||||||
'resource/vs'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// list of folders which are copied to the build folder
|
// list of folders which are copied to the build folder
|
||||||
|
@ -56,6 +55,16 @@ const symlinkFiles = [
|
||||||
'update.rdf',
|
'update.rdf',
|
||||||
'!chrome/skin/default/zotero/**/*.scss',
|
'!chrome/skin/default/zotero/**/*.scss',
|
||||||
'!resource/citeproc_rs_wasm.js',
|
'!resource/citeproc_rs_wasm.js',
|
||||||
|
// We only need a few Monaco languages
|
||||||
|
'!resource/vs/**/*',
|
||||||
|
'resource/vs/loader.js',
|
||||||
|
'resource/vs/editor/editor.main.{js,css,nls.js}',
|
||||||
|
'resource/vs/base/**/*',
|
||||||
|
'resource/vs/basic-languages/javascript/*.js',
|
||||||
|
'resource/vs/basic-languages/typescript/*.js',
|
||||||
|
'resource/vs/basic-languages/xml/*.js',
|
||||||
|
'resource/vs/language/typescript/*.js',
|
||||||
|
'resource/vs/language/json/*.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue