我使用ckEditor。如果我导入 ckEditor 插件,我会收到此错误
No loader is configured for ".svg" files: node_modules/@ckeditor/ckeditor5-core/theme/icons/table.svg
角度版本:17.1.2 @ckeditor/ckeditor5-角度:7.0.1 @ckeditor/ckeditor5-build-classic:41.0.0
import { Autoformat } from '@ckeditor/ckeditor5-autoformat'
export const CK_EDITOR_DEFAULT_CONFIG = {
plugins: [
// Essentials,
// UploadAdapter,
Autoformat,
]
}
Angular Vith esbuild 支持自定义加载程序吗?或者任何其他支持 svg 加载器的解决方案
我将
d.ts
添加到 src,但没有帮助:
declare module '*.svg' {
const content: string
export default content
}
在 17.1.0 版本的 angular.json 中,我们可以在配置中添加加载器:
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
...
"loader": {
".svg": "text"
},