mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Started to use CKEditor 5 as richt text editor.
This commit is contained in:
parent
156301b8a4
commit
dbdfe5ea95
9 changed files with 1575 additions and 49 deletions
|
@ -25,6 +25,8 @@ const CopyPlugin = require('copy-webpack-plugin');
|
|||
const zlib = require('zlib');
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
|
||||
const { styles } = require( '@ckeditor/ckeditor5-dev-utils' );
|
||||
|
||||
// Manually configure the runtime environment if not already configured yet by the "encore" command.
|
||||
// It's useful when you use tools that rely on webpack.config.js file.
|
||||
|
@ -124,8 +126,43 @@ Encore
|
|||
|
||||
// uncomment if you're having problems with a jQuery plugin
|
||||
.autoProvidejQuery()
|
||||
|
||||
.addPlugin( new CKEditorWebpackPlugin( {
|
||||
// See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
|
||||
language: 'en',
|
||||
addMainLanguageTranslationsToAllAssets: true,
|
||||
additionalLanguages: 'all'
|
||||
} ) )
|
||||
|
||||
// Use raw-loader for CKEditor 5 SVG files.
|
||||
.addRule( {
|
||||
test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
|
||||
loader: 'raw-loader'
|
||||
} )
|
||||
|
||||
// Configure other image loaders to exclude CKEditor 5 SVG files.
|
||||
.configureLoaderRule( 'images', loader => {
|
||||
loader.exclude = /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/;
|
||||
} )
|
||||
|
||||
// Configure PostCSS loader.
|
||||
.addLoader({
|
||||
test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: styles.getPostCssConfig( {
|
||||
themeImporter: {
|
||||
themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
|
||||
},
|
||||
minify: true
|
||||
} )
|
||||
}
|
||||
} )
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
//Copy bootstrap map if in debug mode
|
||||
if (Encore.isDev()) {
|
||||
Encore.addPlugin(new CopyPlugin({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue