CDN Configuration
Used to configure the CDN path. To reduce the size of the Umo Editor core package and improve loading speed, Umo Editor introduces some static resources via CDN configuration. These static resources include third-party modules, images, icon resources, etc.
Default Configuration
{
cdnUrl: 'https://unpkg.com/@umoteam/editor-external@4',
}
Using Public CDN
{
// Using unpkg.com
cdnUrl: 'https://unpkg.com/@umoteam/editor-external@latest',
// Or using jsdelivr.net
// cdnUrl: 'https://cdn.jsdelivr.net/npm/@umoteam/editor-external@latest',
}
Using Local Resources
For scenarios like improving loading speed further or working in an intranet environment, you can copy the files under node_modules/@umoteam/editor-external/
to the public/
directory and set cdnUrl
to location.origin
.
You can quickly copy files to the project root directory using the following commands:
mkdir -p public/libs
mkdir -p public/icons
mkdir -p public/static
xcopy node_modules\@umoteam\editor-external\libs\* public\libs\ /E /I
xcopy node_modules\@umoteam\editor-external\icons\* public\icons\ /E /I
xcopy node_modules\@umoteam\editor-external\static\* public\static\ /E /I
Note: After updating the @umoteam/editor
version, please copy the latest @umoteam/editor-external
files to the public
directory. Ensure the version matches @umoteam/editor-external
.
You can also place the files under node_modules/@umoteam/editor-external/
in a suitable location and configure cdnUrl
correctly. Ensure it does not end with a /
.
Configuration Items
cdnUrl
Description: CDN path.
Type: String
Default Value: https://unpkg.com/@umoteam/editor-external@latest
Configuration Items: A valid URL value, must not end with /
.