suren-atoyan / monaco-react

Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins

Home Page:https://monaco-react.surenatoyan.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs/loader.js 加载失败 怎么处理

zj91zj opened this issue · comments

@zj91zj sorry, but I don't understand Chinese.

If you want to use a different CDN, use loader-config

thanks

commented

use loader-config

import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
import Editor, {loader} from '@monaco-editor/react';

loader.config({ monaco });

use monaco-editor-webpack-plugin

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

module.exports = {
	entry: './index.js',
	module: {
		rules: [
			...
		]
	},
	plugins: [new MonacoWebpackPlugin()]
};

I did it the same way you did. However, I'm still getting an error saying the loading has failed. Do I still need to add my own CDN configuration in the loader? Should I place the requested loader.js on our own CDN? @zedfight @suren-atoyan