Angular component library - image references in templates

自作多情 提交于 2021-02-07 11:59:28

问题


I have an npm package that has a number of angular components. In their templates, they reference images. If I copy the images to my application's images directory, the references resolve, but this feels stupid.

Is there a way to have webpack handle image writing so that when App B includes components from App A, the images work in the build and there's no manual copy step involved?


回答1:


If images are not properly required in this npm package then webpack won't be able to process them. You may try something like copy-webpack-plugin or write own copy script to avoid manual copying



来源:https://stackoverflow.com/questions/41879823/angular-component-library-image-references-in-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!