| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // webpack.config.js
- 'use strict';
- /* eslint-env node */
- const path = require('path');
- const { CKEditorTranslationsPlugin } = require('@ckeditor/ckeditor5-dev-translations');
- const { styles } = require('@ckeditor/ckeditor5-dev-utils');
- module.exports = {
- devtool: 'source-map',
- performance: { hints: false },
- entry: path.resolve(__dirname, 'src', 'ckeditor.js'),
- output: {
- library: 'CustomEditors',
- path: path.resolve(__dirname, 'build'),
- filename: 'ckeditor.js',
- libraryTarget: 'umd',
- libraryExport: 'default'
- },
- plugins: [
- // More plugins.
- // ...
- new CKEditorTranslationsPlugin({
- // See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
- language: 'ru',
- additionalLanguages: 'all',
- })
- ],
- module: {
- rules: [
- {
- test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
- use: ['raw-loader']
- },
- {
- test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
- use: [
- {
- loader: 'style-loader',
- options: {
- injectType: 'singletonStyleTag',
- attributes: {
- 'data-cke': true
- }
- }
- },
- 'css-loader',
- {
- loader: 'postcss-loader',
- options: {
- postcssOptions: styles.getPostCssConfig({
- themeImporter: {
- themePath: require.resolve('@ckeditor/ckeditor5-theme-lark')
- },
- minify: true
- })
- }
- }
- ]
- }
- ]
- }
- };
|