Commit c54180e0 authored by jason.xing's avatar jason.xing

【增加】添加webpack对ckeditor5 多语言的支持

parent a09fee46
const {override, fixBabelImports, getBabelLoader, addDecoratorsLegacy, disableEsLint} = require('customize-cra');
const {styles} = require('@ckeditor/ckeditor5-dev-utils');
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
const CKEditorPlugin = new CKEditorWebpackPlugin( {
// Main language that will be built into the main bundle.
language: 'zh-cn',
// 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.
// additionalLanguages: 'all',
// Optional directory for emitted translations. Relative to the webpack's output.
// Defaults to `'translations'`.
// outputDirectory: 'ckeditor5-translations',
// Whether the build process should fail if an error occurs.
// Defaults to `false`.
// strict: true,
// Whether to log all warnings to the console.
// Defaults to `false`.
// verbose: true
} )
const fileLoaderMatcher = function (rule) {
return rule.loader && rule.loader.indexOf(`file-loader`) !== -1;
......@@ -99,6 +122,8 @@ function addPlugin(config) {
l.exclude = reg;
}
config.plugins.push(CKEditorPlugin);
return config;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment