M
M
Maxim Alyoshin2016-05-28 01:57:57
css
Maxim Alyoshin, 2016-05-28 01:57:57

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/'
  }),

, but gulp throws an error
joxi.ru/DrlQBJQF4D8L7m
. Help me please. What exactly was indicated wrong in the path settings.
I turned to the official documentation https://github.com/assetsjs/postcss-assets but did not find anything intelligible there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-05-30
@scalder27

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 question

Ask a Question

731 491 924 answers to any question