diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-09-30 21:10:05 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-15 23:38:33 +0300 |
commit | be5965e3ae4ea1b8e1df028b83ea3533d1e3bd2f (patch) | |
tree | b23c04c72db586c7dcf686203d8831e3ff591894 /webpack.common.js | |
parent | bc495aff638f532870575f8646fe4ad14375183c (diff) |
Build CKEditor from source to disable more features
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'webpack.common.js')
-rw-r--r-- | webpack.common.js | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/webpack.common.js b/webpack.common.js index 4368db184..e9286ca90 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,8 +1,15 @@ const path = require('path'); const BundleAnalyzerPlugin = require('@bundle-analyzer/webpack-plugin') +const CKEditorWebpackPlugin = require('@ckeditor/ckeditor5-dev-webpack-plugin'); +const {styles} = require('@ckeditor/ckeditor5-dev-utils'); const { VueLoaderPlugin } = require('vue-loader'); const plugins = [ + // CKEditor needs its own plugin to be built using webpack. + new CKEditorWebpackPlugin({ + // See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html + language: 'en' + }), new VueLoaderPlugin() ] @@ -46,7 +53,10 @@ module.exports = { { test: /\.js$/, loader: 'babel-loader', - exclude: /node_modules/ + exclude: /node_modules/, + include: [ + path.join(__dirname, 'node_modules', '@ckeditor') + ], }, { test: /\.(png|jpg|gif)$/, @@ -61,7 +71,22 @@ module.exports = { { loader: 'url-loader' } - ] + ], + exclude: path.join(__dirname, 'node_modules', '@ckeditor') + }, + { + test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/, + loader: 'raw-loader' + }, + { + test: /ckeditor5-[^/\\]+[/\\].+\.css$/, + loader: 'postcss-loader', + options: styles.getPostCssConfig({ + themeImporter: { + themePath: require.resolve('@ckeditor/ckeditor5-theme-lark'), + }, + minify: true + }) } ] }, |