1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-02 04:32:54 +02:00

make monaco stylesheet insert just once

This commit is contained in:
Kushagra Gour
2018-12-10 19:18:39 +05:30
parent eb139c8b40
commit 8310b4aa4c
2 changed files with 8 additions and 3 deletions

View File

@ -181,7 +181,9 @@ export default class CodeEditor extends Component {
async loadDeps() {
if (this.props.type === 'monaco' && !isMonacoDepsLoaded) {
loadCss('lib/monaco/monaco.css');
if (!$('#monaco-css')) {
loadCss({ url: 'lib/monaco/monaco.css', id: 'monaco-css' });
}
return import(/* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js').then(
() => {
isMonacoDepsLoaded = true;