From c09657381e720ecb401563b29d746cbf94ee196c Mon Sep 17 00:00:00 2001 From: Orta Date: Wed, 9 Sep 2020 10:28:53 -0400 Subject: [PATCH 1/2] Adds support for both quotes in the TS side --- gulpfile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 9341c27e..677ad14f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -196,6 +196,11 @@ function addPluginContribs(type) { `define('vs/language/json/fillers/monaco-editor-core',[],`, `define('vs/language/json/fillers/monaco-editor-core',['vs/editor/editor.api'],`, ); + // You can find both types of quotes in the TypeScript files + contribContents = contribContents.replace( + `define("vs/language/typescript/fillers/monaco-editor-core",[],`, + `define("vs/language/typescript/fillers/monaco-editor-core",['vs/editor/editor.api'],`, + ); contribContents = contribContents.replace( `define('vs/language/typescript/fillers/monaco-editor-core',[],`, `define('vs/language/typescript/fillers/monaco-editor-core',['vs/editor/editor.api'],`, From 2ff2f65be7e0ef7057729e9c87c844b410b5d1bf Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 9 Sep 2020 17:26:06 +0200 Subject: [PATCH 2/2] Use a regex for injecting `vs/editor/editor.api` as a dependency --- gulpfile.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 677ad14f..1351bc18 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -185,29 +185,8 @@ function addPluginContribs(type) { var contribContents = fs.readFileSync(contribPath).toString(); contribContents = contribContents.replace( - `define('vs/language/css/fillers/monaco-editor-core',[],`, - `define('vs/language/css/fillers/monaco-editor-core',['vs/editor/editor.api'],`, - ); - contribContents = contribContents.replace( - `define('vs/language/html/fillers/monaco-editor-core',[],`, - `define('vs/language/html/fillers/monaco-editor-core',['vs/editor/editor.api'],`, - ); - contribContents = contribContents.replace( - `define('vs/language/json/fillers/monaco-editor-core',[],`, - `define('vs/language/json/fillers/monaco-editor-core',['vs/editor/editor.api'],`, - ); - // You can find both types of quotes in the TypeScript files - contribContents = contribContents.replace( - `define("vs/language/typescript/fillers/monaco-editor-core",[],`, - `define("vs/language/typescript/fillers/monaco-editor-core",['vs/editor/editor.api'],`, - ); - contribContents = contribContents.replace( - `define('vs/language/typescript/fillers/monaco-editor-core',[],`, - `define('vs/language/typescript/fillers/monaco-editor-core',['vs/editor/editor.api'],`, - ); - contribContents = contribContents.replace( - `define('vs/basic-languages/fillers/monaco-editor-core',[],`, - `define('vs/basic-languages/fillers/monaco-editor-core',['vs/editor/editor.api'],`, + /define\((['"][a-z\/\-]+\/fillers\/monaco-editor-core['"]),\[\],/, + 'define($1,[\'vs/editor/editor.api\'],' ); extraContent.push(contribContents);