I had a lot of trouble getting this up and running. I ended up adding this to webpack.mix.js
/**
* CK Editor Config
*/
const CKEStyles = require('@ckeditor/ckeditor5-dev-utils').styles
const CKERegex = {
svg: /ckeditor5-[^/\]+[/\]theme[/\]icons[/\][^/\]+\.svg$/,
css: /ckeditor5-[^/\]+[/\]theme[/\].+\.css$/
}
Mix.listen('configReady', webpackConfig => {
const rules = webpackConfig.module.rules
const targetSVG = /(\.(png|jpe?g|gif|webp)$|^((?!font).)*\.svg$)/
const targetFont = /(\.(woff2?|ttf|eot|otf)$|font.*\.svg$)/
const targetCSS = /\.css$/
// Exclude CK Editor regex from mix's default rules
for (let rule of rules) {
if (rule.test.toString() === targetSVG.toString()) {
rule.exclude = CKERegex.svg
} else if (rule.test.toString() === targetFont.toString()) {
rule.exclude = CKERegex.svg
} else if (rule.test.toString() === targetCSS.toString()) {
rule.exclude = CKERegex.css
}
}
})
/**
* Webpack Config for CK Editor
*/
mix.webpackConfig({
module: {
rules: [
{
test: CKERegex.svg,
use: ['raw-loader']
},
{
test: CKERegex.css,
use: [
{
loader: 'postcss-loader',
options: {
postcssOptions: CKEStyles.getPostCssConfig({
themeImporter: {
themePath: require.resolve('@ckeditor/ckeditor5-theme-lark')
},
minify: true
})
}
}
]
}
]
}
})
Further reading: https://github.com/ckeditor/ckeditor5-vue/issues/23