Answer the question
In order to leave comments, you need to log in
How to configure postcss-assets?
Good day to all. There is a project with this joxi.ru/5md7BX7hvgODMr structure.
I want to set up the postcss-assets plugin so that when I run the background resolve('img.jpg') command, the plugin automatically sets paths to the given image.
in the Task I specified the following path settings
assets({
basePath: 'dist/',
loadPath: ['img/'],
relativeTo: 'css/'
}),
Answer the question
In order to leave comments, you need to log in
It's alarming that basePath looks in 'dist'. It is possible that at the time of the task execution there are no pictures yet. It's worth checking that image repositioning happens before postcss processing. And I did not find the relativeTo option in the documentation - only relative.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question