Open qlaffont opened 11 months ago
I'll try.
hi @qlaffont I have solved this problem and you can now install v0.5.15 to solve this error.
confirmed for beforeBundle: false but beforeBundle: true still say that no image module is found
BeforeBundle is used to control true to convert images after the bundle is completed. False is for the vite load module, when we represent a new set of image resources, which may need to be integrated into a vite load mode. Now, when we run in load, we do not find the image resources, so we need to manually modify the source code after bundle. I tried earlier today that it can be compiled and compressed normally. Can you provide a warehouse that can be reproduced?
@ErKeLost after a long debugging period:
I'll check what you said later.
Any update?
I'll try to recreate it today. I'm sorry I've been a little busy lately.
@qlaffont hi. The newly created solid ssr template seems to have some problems. Build will fail. The reason you said that the image resources are not stored in the dist directory may be because there is a problem with the output path acquisition of ssr.
BeforeBundle false is equivalent to manually managed output files, and when beforeBundle is true, we hijack the module operation flow of vite in the process of load hooks. In the end, these plug-ins get the ssr options inside vite, so there is no problem.
I may have to remove the beforeBundle attribute to the next maior version
If can solve the problem that the module can not find, then can solve a lot of problems of finding the path.
So you are telling me, at this point we have no solution to use this plugin
It can be solved at present, but pnpm create solid build seems to have some problems at present. I failed to build. Can you provide a warehouse that can be reproduced?
You have the repro here @ErKeLost : https://github.com/qlaffont/solid-start-project
I tried beforeBundle false to find the picture in dist after build in your repo.
Did you say that the picture could not be found in dist after setting false?
I don't know if there's a problem with my understanding, and if it is, please tell me that I will continue to fix this problem, and I found that there is less problem of finding build products in ssr. I'll solve this problem first.
I have updated the example with the img tag and it doesn't work : https://github.com/qlaffont/solid-start-project/commit/4681c6cf57bd5847da8c8c8d68c571f2ea1b667a WITH beforeBundle: false
:
The image is not found in dist
With beforeBundle: true
:
[unplugin-imagemin] 📦 📦 Process start with Mode sharp
â–¶ Not Found Image Module, if you want to use style with image style, such as "background-image" you can use "beforeBundle: false" in plugin config
✔ Image conversion completed!
Image is found in dist but not compressed
In the case of url import, you can't find the corresponding module. You can use the module import method first. I will solve this problem as soon as possible.
Thank you for your report.
I keep the issue until it is possible, because I need to upload image as background sometimes and I need to have these files.
When do you think you will work on this ? It's kind of critical for me ^^"
When do you think you will work on this ? It's kind of critical for me ^^"
I have been very busy because of my work. I will solve this problem as soon as possible this week.
@ErKeLost any update ?
@ErKeLost any update ?
I'm so sorry. I've been too busy at work lately. I don't have time to check it out.
Steps to reproduce
What is expected?
able to optimize images
What is actually happening?
[unplugin-imagemin] 📦 📦 Process start with Mode sharp ▶ Not Found Image Module, if you want to use style with image style, such as "background-image" you can use "beforeBundle: false" in plugin config
System Info
Any additional comments?
Working with solid-start : https://start.solidjs.com/getting-started/project-setup
If I use "beforeBundle" with false ->