Skip to content

Commit 1608b8d

Browse files
authored
build(webpack): use custom build monaco-editor (#36)
Refs swagger-api/swagger-editor#4848
1 parent 3f0eaae commit 1608b8d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-scripts/config/webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,11 @@ module.exports = function (webpackEnv) {
859859
process: 'process/browser.js',
860860
Buffer: ['buffer', 'Buffer'],
861861
}),
862+
new webpack.BannerPlugin({
863+
banner: "globalThis.vscode = { process: Symbol.for('vscode') };",
864+
raw: true, // This is important, it tells webpack to prepend the code as-is.
865+
entryOnly: true, // This adds the banner only to the beginning of the bundle.
866+
}),
862867
enableProgressPlugin &&
863868
new webpack.ProgressPlugin({
864869
activeModules: false,

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"buffer": "^6.0.3",
9696
"react": ">= 16",
9797
"typescript": "^3.2.1 || ^4",
98-
"monaco-editor": ">= 0.44.0",
98+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api",
9999
"stream-browserify": "^3.0.0",
100100
"stream-http": "^3.2.0",
101101
"url": ">=0.11.2"

0 commit comments

Comments
 (0)