@ckeditor/vite-plugin-ckeditor5

中文文档
0.1.3发布于 2023/06/02GPL-2.0-or-laterTypeScriptESM + CJS近 30 天下载 4.2万

CKEditor 5 Vite plugin ======================

此软件包已被标记为弃用

The Vite plugin is deprecated, and new versions will not be released. CKEditor 5 version 42.0.0 works with Vite without any special setup. For more information, read the migration guide: https://ckeditor.com/docs/ckeditor5/latest/updating/nim-migration/customized-builds.html

原始使用文档
文档目录8 节
  1. ⚠️ Experimental feature
  2. Usage
  3. Options:
  4. Known issues
  5. Releasing package
  6. Changelog
  7. Publishing
  8. License

CKEditor 5 Vite plugin

Integrate the CKEditor 5's build process in your Vite setup.

⚠️ Experimental feature

Using this plugin to build CKEditor 5 from source in Vite is still in the experimental phase. We encourage you to test it and give us feedback. However, there might be some issues in more complex application/usecases, thus using this solution in production applications is not yet recommended.

Usage

You should use this plugin when building CKEditor 5 from source in a Vite application. It handles loading the .svg icons and styles from the packages and theme package. If your editor is already built (e.g you downloaded it from CKEditor 5 Online Builder) then this plugin is not needed.

  1. Install the package.
npm install -D @ckeditor/vite-plugin-ckeditor5
# or
yarn add -D @ckeditor/vite-plugin-ckeditor5
  1. Import and use the plugin in Vite configuration.
// vite.config.js
import { defineConfig } from 'vite';
import ckeditor5 from '@ckeditor/vite-plugin-ckeditor5';

export default defineConfig( {
    plugins: [
        ckeditor5( { theme: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) } )
    ]
} );

Options:

theme

This should be an absolute path to the main file in theme package. Example:

{ theme: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) }

Note: If you are using this plugin in an ESM project you may encounter an error stating that require.resolve is not a function. In this case you can add the following to the top of your vite.config.js file:

import { createRequire } from 'node:module';
const require = createRequire( import.meta.url );

Known issues

  • This plugin will not emit any translation files and only english is currently supported.
  • When using the Export to Word or Export to PDF plugins the editor styles will not be automatically collected.

Releasing package

Changelog

Before starting the release process, you need to generate the changelog:

npm run changelog

Publishing

After generating the changelog, you are able to release the package.

First, you need to bump the version:

npm run release:bump-version

You can also use the --dry-run option in order to see what this task does.

After bumping the version, you can publish the changes:

npm run release:publish

As in the previous task, the --dry-run option is also available.

Note: Only the dist/ directory will be published.

License

Licensed under the terms of GNU General Public License Version 2 or later. For full details about the license, please check the LICENSE.md file.

版本与发布记录

@ckeditor/vite-plugin-ckeditor5 共发布 4 个版本,首次发布于 2022/12/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.3latest2023/06/023 年前
0.1.22023/06/013 年前
0.1.12023/01/163 年前
0.1.02022/12/223 年前

关于 @ckeditor/vite-plugin-ckeditor5 的常见问题

@ckeditor/vite-plugin-ckeditor5 是什么?

CKEditor 5 Vite plugin ======================注意:该包已被作者标记为弃用——The Vite plugin is deprecated, and new versions will not be released. CKEditor 5 version 42.0.0 works with Vite without any special setup. For more information, read the migration guide: https://ckeditor.com/docs/ckeditor5/latest/updating/nim-migration/customized-builds.html

如何安装 @ckeditor/vite-plugin-ckeditor5?

在项目目录运行 npm install @ckeditor/vite-plugin-ckeditor5,或使用 pnpm add / yarn add / bun add。

@ckeditor/vite-plugin-ckeditor5 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ckeditor/vite-plugin-ckeditor5 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ckeditor/vite-plugin-ckeditor5 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^14.18.0 || >= 16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ckeditor/vite-plugin-ckeditor5 可以商用吗?

@ckeditor/vite-plugin-ckeditor5 使用 GPL-2.0-or-later 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以兼容的 GPL 许可开源。仅在内部使用、不对外分发时不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@ckeditor/vite-plugin-ckeditor5 的下载量有多少?

根据 npm 官方下载统计,@ckeditor/vite-plugin-ckeditor5 在 2026/10/10 – 2026/11/08 这 30 天内被下载 41,905 次,日均约 1,397 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ckeditor/vite-plugin-ckeditor5 还在维护吗?

最新版本 0.1.3 发布于 2023/06/02(3 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/12/22。作者已将其标记为弃用,新项目建议寻找替代方案。