Skip to content

Commit b98761c

Browse files
committed
Add minification to Vite config and update Editor component to use a ref for the editor container
1 parent b9027d9 commit b98761c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/Editor.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Editor extends Component {
2020
width: 0,
2121
isReady: false
2222
};
23+
this.editorContainerRef = React.createRef();
2324
}
2425

2526

@@ -70,13 +71,14 @@ class Editor extends Component {
7071
<div style={{
7172
height: "100%",
7273
width: "100%"
73-
}}>
74+
}} ref={this.editorContainerRef}>
7475
<ReactResizeDetector
7576
handleWidth
7677
handleHeight
7778
onResize={this.handleResize}
7879
refreshMode="debounce"
79-
refreshRate={50} />
80+
refreshRate={50}
81+
targetRef={this.editorContainerRef} />
8082
{
8183
isReady ? <MonacoEditor
8284
height={height}

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export default defineConfig({
1313
rollupOptions: {
1414
external: ["react-monaco-editor", "react-resize-detector"],
1515
},
16+
minify: true,
1617
},
1718
});

0 commit comments

Comments
 (0)