How to add custom js and css files in jHipster 4

﹥>﹥吖頭↗ 提交于 2020-01-15 03:10:17

问题


As I'm not familiar with webpack, so I am facing some difficulties while working with jhipster 4. I want to add some application level js and css files in jHipster. Can someone suggest how to do that.


回答1:


We learned while implementing primeng to add it in the src/main/webapp/content/scss/vendor.scss for example:

@import '~primeng/resources/primeng.min.css';
@import '~primeng/resources/themes/bootstrap/theme.css';

We added the scss option when creating the jhipster app




回答2:


Edit src/main/webapp/content/css/global.css file while you are running yarn start: your changes should be hot reloaded. If you have several CSS , either use @import or import them in vendor.ts.

Same thing for your custom js files which should be under src/main/webapp/app but probably written in Typescript rather than javascript. Of course, I assume that you have some knowledge about angular to do so.



来源:https://stackoverflow.com/questions/42069364/how-to-add-custom-js-and-css-files-in-jhipster-4

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