# @ckeditor/vite-plugin-ckeditor5

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

Latest version **0.1.3** (published 2023-06-02) · GPL-2.0-or-later license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @ckeditor/vite-plugin-ckeditor5
pnpm add @ckeditor/vite-plugin-ckeditor5
yarn add @ckeditor/vite-plugin-ckeditor5
bun add @ckeditor/vite-plugin-ckeditor5
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2023-06-02 |
| First published | 2022-12-22 |
| Weekly downloads | 0 |
| License | GPL-2.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^14.18.0 \|\| >= 16 |
| Dependencies | 4 |
| Unpacked size | 16.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | CKSource |
| Maintainers | ckeditor |

## Links

- npm: https://www.npmjs.com/package/@ckeditor/vite-plugin-ckeditor5
- Repository: https://github.com/ckeditor/vite-plugin-ckeditor5
- Issues: https://github.com/ckeditor/vite-plugin-ckeditor5/issues
- npm.io page: https://npm.io/package/@ckeditor/vite-plugin-ckeditor5

## Dependencies (4)

- [postcss](https://npm.io/package/postcss.md) ^8.4.12
- [postcss-import](https://npm.io/package/postcss-import.md) ^14.1.0
- [postcss-mixins](https://npm.io/package/postcss-mixins.md) ^9.0.2
- [postcss-nesting](https://npm.io/package/postcss-nesting.md) ^10.1.4

## Recent versions

- 0.1.3 (latest) — 2023-06-02
- 0.1.2 — 2023-06-01
- 0.1.1 — 2023-01-16
- 0.1.0 — 2022-12-22

## README

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

Integrate the [CKEditor 5](https://ckeditor.com)'s build process in your [Vite](https://vitejs.dev/) 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](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/integrating-from-source.html) 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](https://ckeditor.com/ckeditor-5/online-builder/)) then this plugin is not needed.

1. Install the package.
```bash
npm install -D @ckeditor/vite-plugin-ckeditor5
# or
yarn add -D @ckeditor/vite-plugin-ckeditor5
```

2. Import and use the plugin in Vite configuration.
```js
// 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:

```js
{ 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:

```js
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:

```bash
npm run changelog
```

### Publishing

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

First, you need to bump the version:

```bash
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:

```bash
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](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.

---
_Source: https://npm.io/package/@ckeditor/vite-plugin-ckeditor5 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
