V
V
Victor2017-08-11 16:24:53
css
Victor, 2017-08-11 16:24:53

How to change all paths in styl from command line?

There is a need to add a prefix to all paths in the styles so that after compilation it turns out . The documentation shows how to do this using a script , but I need to do this from the cli, since it is part of the npm script. There is an example in the doc (at the very bottom) of how you can pass call conditions to the plugin, and I tried to do it like this (found here ):background: url("images/image.jpg")background: url("../prefix/images/image.jpg")

stylus --use url --with "{ paths: [ '../prefix/' ] }" src/styl --sourcemap --out dist/css

But it doesn't work. There are no errors, but the paths do not change either.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Froggyweb, 2017-08-11
@Froggyweb

Resolve Relative URL Import Paths
Enabling this option will rewrite URLs so they are always relative to the base file.
Or I didn't understand something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question