Skip to content

Commit a190e6c

Browse files
authored
Merge branch 'master' into editorIss
2 parents 138645a + eb8abaa commit a190e6c

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

apps/remix-ide/webpack.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const nxWebpack = require('@nrwl/react/plugins/webpack')
22
const TerserPlugin = require('terser-webpack-plugin')
3+
const CopyWebpackPlugin = require("copy-webpack-plugin");
4+
35

46
module.exports = config => {
57
const nxWebpackConfig = nxWebpack(config)
@@ -12,7 +14,15 @@ module.exports = config => {
1214
net: 'empty',
1315
module: 'empty',
1416
child_process: 'empty'
15-
}
17+
},
18+
plugins: [
19+
...nxWebpackConfig.plugins,
20+
new CopyWebpackPlugin({
21+
patterns: [
22+
{ from: "../../../node_modules/monaco-editor/dev/vs/", to: "assets/js/monaco-editor/dev/vs" },
23+
].filter(Boolean)
24+
})
25+
]
1626
}
1727

1828
if (process.env.NODE_ENV === 'production') {

libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line
2-
import Editor from '@monaco-editor/react'
2+
import Editor, { loader } from '@monaco-editor/react'
33
import { reducerActions, reducerListener, initialState } from './actions/editor'
44
import { language, conf } from './syntax'
55

@@ -44,6 +44,8 @@ type sourceMarkerMap = {
4444
[key: string]: [sourceMarker];
4545
}
4646

47+
loader.config({ paths: { vs: 'assets/js/monaco-editor/dev/vs' } })
48+
4749
/* eslint-disable-next-line */
4850
export interface EditorUIProps {
4951
activated: boolean
@@ -308,7 +310,7 @@ export const EditorUI = (props: EditorUIProps) => {
308310

309311
props.editorAPI.getFontSize = () => {
310312
if (!editorRef.current) return
311-
return editorRef.current.getOption(42).fontSize
313+
return editorRef.current.getOption(43).fontSize
312314
}
313315

314316
(window as any).addRemixBreakpoint = (position) => { // make it available from e2e testing...
@@ -349,10 +351,10 @@ export const EditorUI = (props: EditorUIProps) => {
349351
}
350352
})
351353
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_EQUAL, () => {
352-
editor.updateOptions({ fontSize: editor.getOption(42).fontSize + 1 })
354+
editor.updateOptions({ fontSize: editor.getOption(43).fontSize + 1 })
353355
})
354356
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_MINUS, () => {
355-
editor.updateOptions({ fontSize: editor.getOption(42).fontSize - 1 })
357+
editor.updateOptions({ fontSize: editor.getOption(43).fontSize - 1 })
356358
})
357359
}
358360

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"jszip": "^3.6.0",
180180
"latest-version": "^5.1.0",
181181
"merge": "^2.1.1",
182+
"monaco-editor": "^0.30.1",
182183
"npm-install-version": "^6.0.2",
183184
"react": "^17.0.2",
184185
"react-beautiful-dnd": "^13.1.0",

0 commit comments

Comments
 (0)