Running tasks: posthtml
Running "posthtml" task
Running "posthtml:target" (posthtml) task
Verifying property posthtml.target exists in config…OK
Files: output/KiraRootFile.html -> KiraRootFile.outputgrunt.html
Files: output/KiraFolder/KiraFolderFile.html -> KiraFolder/KiraFolderFile.outputgrunt.html
Files: output/KiraFolder/KiraSubfolder/KiraSubfolderFile.html -> KiraFolder/KiraSubfolder/KiraSubfolderFile.outputgrunt.html
Options: use=[null], singleTags=[], closingSingleTag="default", skipParse=null, sync=null
Reading output/KiraRootFile.html…OK
Reading output/KiraFolder/KiraFolderFile.html…OK
Reading output/KiraFolder/KiraSubfolder/KiraSubfolderFile.html…OK
Warning: ENOENT: no such file or directory, open '/home/travis/build/Kristinita/SashaGruntDebugging/assets/NeliaLeaves.jpg' Use --force to continue.
4. Not helped
4.1. posthtml-cli
I’m not getting the desired behavior, if I use posthtml-cli instead of grunt-posthtml. See 4.3 and 5.1 sections of my comment from previous issue.
4.2. “root” option
It doesn’t work for the path structure as in my MCVE. As @Scrum said in 2020:
At the moment, relative paths are supported, but it should be borne in mind that they are resolved relative to the running process + root options and not relative to the html file
5. Environment
Operating system:
Local — Microsoft Windows [Version 10.0.19041.1415]
1. Summary
It would be nice, if posthtml-img-autosize will support relative paths for any valid path structure.
2. MCVE
See this configuration on the
KiraPosthtmlPaths2022
branch of my demo GitHub repository.It would be nice, if posthtml-img-autosize will successfully work for this configuration.
Folder structure:
KiraRootFile.html
:KiraFolderFile.html
:KiraSubfolderFile.html
:Any
NeliaLeaves.jpg
imagePart of
package.json
:Gruntfile.coffee
:Part of
.travis.yml
:3. Behavior
3.1. Desired
Successful adding width and height for
<img>
in all three HTML files above like here:3.2. Current
Travis build:
4. Not helped
4.1. posthtml-cli
I’m not getting the desired behavior, if I use posthtml-cli instead of grunt-posthtml. See 4.3 and 5.1 sections of my comment from previous issue.
4.2. “root” option
It doesn’t work for the path structure as in my MCVE. As @Scrum said in 2020:
5. Environment
Operating system:
Node.js 18.8.0
grunt-cli v1.3.2
posthtml-cli 0.8.0
Thanks.