Nondeterministic Programming Methodology
Miss any of our Open RFC calls?Watch the recordings here! »

@ckeditor/ckeditor5-dev-webpack-plugin

23.1.1 • Public • Published

CKEditor 5 webpack plugin

Intergrate CKEditor 5's build process with your webpack setup.

Requires webpack ^4.0.0.

More information about development tools packages can be found at the following URL: https://github.com/ckeditor/ckeditor5-dev.

Usage

The current functionality of this plugin is limited to localizing the editor builds. Add this plugin to your webpack configuration to change the language of the editor's interface or build the editor with support for multiple languages (by extracting multiple language files):

const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
 
// Define webpack plugins ...
    plugins: [
        new CKEditorWebpackPlugin( options ),
 
        // Other webpack plugins...
    ]
// ...

Options:

language

The main language that will be built into the main bundle, e.g. en.

additionalLanguages

Additional languages that will be emitted to the outputDirectory. This option can be set to an array of language codes or 'all' to build all found languages. The bundle is optimized for one language when this option is omitted.

outputDirectory

An optional directory for emitted translations. Relative to the webpack's output. Defaults to 'translations'.

strict

When set to true, it stops the webpack compilation when an error occurs. Defaults to false.

verbose

When set to true, it logs all warnings found during the compilation. Defaults to false.

addMainLanguageTranslationsToAllAssets

When set to true, all generated assets (bundles) will include translations for the main language.

buildAllTranslationsToSeparateFiles

When set to true, all translations will be output to the translations directory (or the directory specified by the outputDirectory option).

packageNamesPattern

A pattern which is used for determining if a package may contain translations (PO files) in the <package_name>/lang/translations directory. Defaults to /[/\\]ckeditor5-[^/\\]+[/\\]/.

sourceFilesPattern

A pattern which is used for determining if a file may contain messages to translate. Defaults to /[/\\]ckeditor5-[^/\\]+[/\\]src[/\\].+\.js$/.

translationsOutputFile

An option that allows specifying the target file to which all translations will be outputted. This option supports a string, regular expression and a function. If no asset exists with the name, it will be created automatically and filled with translations.

corePackagePattern

(internal) A pattern which is used to get a path to the core translation package from corePackageSampleResourcePath, which contains the main translations. Defaults to /[/\]ckeditor5-core/.

corePackageSampleResourcePath

(internal) A sample path to the ckeditor5-core package. A test import to this file shows if the ckeditor5-core package is available and allows to load the core package translations first.

You can read more about localizing the editor in the Setting the UI language guide.

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.

Keywords

none

Install

npm i @ckeditor/ckeditor5-dev-webpack-plugin

DownloadsWeekly Downloads

10,282

Version

23.1.1

License

GPL-2.0-or-later

Unpacked Size

28.8 kB

Total Files

7

Last publish

Collaborators

  • avatar