Images not found when doing a production build with JHipster

自古美人都是妖i 提交于 2019-12-07 13:04:52

问题


When I am trying to deploy my application in my prod the WAR do not have the images directory so i get my application deploy without any images.

What could be the problem?


回答1:


It looks like the cause of the problem is "gulp-imagemin", as a workaround remove this line:

.pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true}))

from: gulpfile.js




回答2:


Your images must be in src/main/webapp/content/images to get minified and copied by gulp to target/www/content/images and then be copied at the root of you war in content/images by maven or gradle.




回答3:


If gulp-imagemin says it minified 0 images, it's often due to missing binaries needed in these node modules:

  • optipng
  • jpegtran
  • gifsicle

If you look eg. into node_modules/optipng-bin, you'll see that the optipng binary is missing (should be in a vendor subfolder).

They are not compiled during npm install, and it's completely silent :)

Installing the zlib1g-dev package fixed the issue on a fresh Debian 9 system.

I had to install build-base and zlib-dev https://github.com/imagemin/optipng-bin/issues/84

Generally speaking, you need several build tools on your system to build a JHipster prod package (make, g++ for scss, etc.).



来源:https://stackoverflow.com/questions/36982683/images-not-found-when-doing-a-production-build-with-jhipster

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