@ckeditor/ckeditor5-dev-build-tools

中文文档
63.1.3发布于 2026/11/09GPL-2.0-or-laterTypeScriptES Module近 30 天下载 1.3万

Rolldown-based tools used to build CKEditor 5 packages.

原始使用文档
文档目录6 节
  1. API
  2. CLI
  3. JavaScript API
  4. Options
  5. Changelog
  6. License

CKEditor 5 Build Tools

npm version CircleCI

This package can be used to build CKEditor 5 plugins compatible with the new installation methods, while the source code is still written for the old methods. It overrides the imports during the build process to make the plugin compatible with the new installation methods.

API

This package can be used as a CLI tool or via the JavaScript API.

CLI

The CLI tool can be used as follows:

npx @ckeditor/ckeditor5-dev-build-tools \
  --input=src/index.js \
    --output=dist/index.js \
    --source-map # Other options

JavaScript API

The JavaScript API can be used as follows:

import { build } from '@ckeditor/ckeditor5-dev-build-tools';

await build( {
    input: 'src/index.js',
    output: 'dist/index.js',
    sourceMap: true,
    // Other options
} );

Options

input / --input=[path]

Type: string

Default value: src/index.ts

The path to the input file.

output / --output=[path]

Type: string

Default value: dist/index.js

The path to the output file. All other assets like CSS files, translations, source maps, etc. will be saved in the same directory. When used with the clean options, this path will be used to determine the directory to delete.

tsconfig / --tsconfig=[path]

Type: string

Default value: tsconfig.json

The path to the TypeScript configuration file. This option can be ignored if the project does not use TypeScript.

banner / --banner=[path]

Type: string

Default value: ''

The path to the banner file. This file must export a variable named banner, which is a string that is added to the beginning of the .js, .css, and .d.ts files. The banner content must not violate JavaScript or CSS syntax.

Example of the banner file:

export const banner =
`/**
 * This is a custom banner that uses comment syntax valid in both JavaScript and CSS.
 */
`;

translations / --translations=[path]

Type: string

Default value: ''

Glob-compliant path to the translation files. This option can be ignored if the plugin doesn't provide translations.

Example value: **/lang/translations/*.ts

declarations / --declarations

Type: boolean

Default value: false

Whether to generate TypeScript declaration files.

sourceMap / --source-map

Type: boolean

Default value: false

Whether to generate a source map.

minify / --minify

Type: boolean

Default value: false

Whether to minify the output.

clean / --clean

Type: boolean

Default value: false

Whether to clean the output directory before building. The directory to clean is based on the output option.

browser / --browser

Type: boolean

Default value: false

Whether to build the CKEditor5 plugin for the browser. This option will cause the tool to output an ESM and UMD bundles that can be used in the browser. Additionally, some of the imports in the output files will be slightly different compared to the Node.js build.

If this option is enabled, the name option must be specified.

name / --name=[name]

Type: string

Default value: ''

The name of the UMD bundle. This name will be used as the global variable name when the bundle is loaded in the browser.

This option is required if the `browser' option is enabled.

globals / --globals=[moduleID:Global]

Type: { [ name: string ]: string } | ( ( name: string ) => string ) | string[]

Default value: {}

Pairs of external package names and associated global variables used in the umd build.

The list already contains ckeditor5 and ckeditor5-premium-features which are mapped to CKEDITOR and CKEDITOR_PREMIUM_FEATURES.

When using the CLI, this option can be used multiple times.

Example value: --globals=external-id:variableName --globals=another-external-id:anotherVariableName

When using the JavaScript API, the option must be an object.

Example value:

globals: {
    'external-id': 'variableName',
    'another-external-id': 'anotherVariableName'
}

external / --external=[path]

Type: string[] | string

Default value: []

A list of external dependencies that should not be bundled.

The list of external dependencies is automatically extended to include all dependencies of ckeditor5 and ckeditor5-premium-features if they are provided as external dependencies. For example, if your plugin uses @ckeditor/ckeditor5-core and @ckeditor/ckeditor5-engine, you can specify ckeditor5 in the external option to exclude them from the bundle.

When using the CLI, this option can be used multiple times.

Example value: --external=lodash --external=moment

When using the JavaScript API, the option must be an array.

Example value: external: [ 'lodash', 'moment' ]

Changelog

See the CHANGELOG.md file.

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/ckeditor5-dev-build-tools 共发布 166 个版本,首次发布于 2024/02/29;过去 12 个月发布了 80 个版本。

版本发布日期距今
63.1.3latest2026/11/09今天
63.1.22026/11/063 天前
54.11.0latest-v542026/11/036 天前
63.1.12026/11/027 天前
61.4.0latest-v612026/10/2812 天前
54.10.02026/10/2812 天前

其他发布通道:next → 54.2.1,alpha → 57.0.0-alpha.1,latest-v61 → 61.4.0,latest-v54 → 54.11.0。

关于 @ckeditor/ckeditor5-dev-build-tools 的常见问题

@ckeditor/ckeditor5-dev-build-tools 是什么?

Rolldown-based tools used to build CKEditor 5 packages.

如何安装 @ckeditor/ckeditor5-dev-build-tools?

在项目目录运行 npm install @ckeditor/ckeditor5-dev-build-tools,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ckeditor5-dev-build-tools,可以用 npx ckeditor5-dev-build-tools 直接运行。

@ckeditor/ckeditor5-dev-build-tools 支持 TypeScript 吗?

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

@ckeditor/ckeditor5-dev-build-tools 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ckeditor/ckeditor5-dev-build-tools 需要什么版本的 Node.js?

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

@ckeditor/ckeditor5-dev-build-tools 可以商用吗?

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

@ckeditor/ckeditor5-dev-build-tools 的下载量有多少?

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

@ckeditor/ckeditor5-dev-build-tools 还在维护吗?

最新版本 63.1.3 发布于 2026/11/09(今天);至今共发布 166 个版本,其中过去 12 个月发布了 80 个;首次发布于 2024/02/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。