h1 {
background-image: url('header-background.png');
}
.
├── my.css
├── header-background.png → header-background.dVkX3MK.png
└── header-background.dVkX3MK.png
webdeps replace . my.css
h1 {
background-image: url('header-background.dVkX3MK.png');
}
You can use webdeps list
to list dependencies of an asset, which can be useful in build tools. For
example:
my.css : css/my.css $(shell webdeps list css/my.css)
webdeps replace --css . < $< > $@
%.png : image/%.png
optipng -out $@ $<
Running make my.css
will ensure that any assets referenced in my.css
are available before running
the build commands.
webdeps --help
Webdeps looks for:
@import
statements andurl
function calls containing literal URLs
import
statements
Webdeps excludes any data:
URIs and any URLs with hostnames you haven’t explicitly included.
- Support HTML (i.e.
src
attribute ofimg
tag, etc.). - Support arbitrarily nested assets (CSS attributes in JS inside of HTML, etc.).
- Support asset mapping in manifest files (instead of just symlinks in directories).
- Export a PostCSS plugin.