webdiscus / pug-plugin

Renders Pug template to HTML or template function. Resolves source files of scripts, styles, images in Pug . Uses Pug template as entry point.
https://webdiscus.github.io/pug-plugin/hello-world
ISC License
73 stars 8 forks source link

Images are broken after build #68

Closed a-gunderin closed 1 year ago

a-gunderin commented 1 year ago

Hello team. For some reason images are broken after build (jpg, png and webp; svgs are fine). Repo: https://github.com/a-gunderin/webpack-starter I'm not sure that this issue connected with pug-plugin. But I could not find a solution to this issue anywhere. I would be grateful if you could tell me what the trick is. Regards.

webdiscus commented 1 year ago

Hello @a-gunderin,

thanks for the issue report. I will research the problem.

webdiscus commented 1 year ago

@a-gunderin

The pug-plugin doesn't touch images, it replaces the source filename with the output filename.

The strange atomizer-plugins does not work accurately and the image content is duplicated in the image file. If you disable the atomizer, then images are generated correctly.

webdiscus commented 1 year ago

@a-gunderin

This is the atomizer-plugins bug. This plugin brake the binary images, but SVG is ok. Please create an issue ticket by the atomizer-plugin.

Here is the PR with reproducible issue. No pug-plugin, pure JS + import an image => output image is broken.

a-gunderin commented 1 year ago

Many thanks!