Can';t在CKEditor中本地添加mathtype插件
但是当我改变mathtype路径时,我得到了一个错误Can';t在CKEditor中本地添加mathtype插件,ckeditor,Ckeditor,但是当我改变mathtype路径时,我得到了一个错误 由于我们无法直接从CRA应用程序的节点模块文件夹访问文件,由于网页包配置,我们应该在构建时将@wiris/mathtype-ckeditor4/文件夹复制到公共文件夹 要做到这一点,首先集成自定义网页而不弹出它。然后安装以在生成时复制文件,最后在config overrides.js中添加此代码段以将mathtype复制到公用文件夹中的mathtype-ckeditor4文件夹中 CKEDITOR.plugins.addExternal(
由于我们无法直接从CRA应用程序的
节点模块
文件夹访问文件,由于网页包配置,我们应该在构建时将@wiris/mathtype-ckeditor4/
文件夹复制到公共
文件夹
要做到这一点,首先集成自定义网页而不弹出它。然后安装以在生成时复制文件,最后在config overrides.js中添加此代码段以将mathtype复制到公用文件夹中的mathtype-ckeditor4
文件夹中
CKEDITOR.plugins.addExternal(
'ckeditor_wiris',
'../node_modules/@wiris/mathtype-ckeditor4/',
'plugin.js'
)
最后,将onBeforeLoad
中的代码更改为
CKEDITOR.plugins.addernal('CKEDITOR_wiris','/mathtype-ckeditor4/,'plugin.js')
这样我们就可以在CKEditor中本地安装和使用mathtype
CKEDITOR.plugins.addExternal(
'ckeditor_wiris',
'../node_modules/@wiris/mathtype-ckeditor4/',
'plugin.js'
)
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = function override (config, env) {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{ from: 'node_modules/@wiris/mathtype-ckeditor4', to: 'mathtype-ckeditor4' }
]
})
)
return config
}