npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ckeditor/ckeditor5-dev-build-tools

v43.0.1

Published

Rollup-based tools used to build CKEditor 5 packages.

Downloads

8,991

Readme

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: **/*.po

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' ]

rewrite

Type: string[]

Default value: []

A list of imports to rewrite in the output file. This option can be used if one of the dependencies provided in external has a separate build for the new install methods that should be used instead of the one used in the source code.

This option is only available for the JavaScript API.

Example value: rewrite: [ 'dependency', 'dependency/dist/index.js' ]

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.