This is a follow up the bug fix in #15189. With the example given in that issue, the `css.Build` would be performed twice, which was unfortunate.
This commit fixes that by resuming the transformation from the last executed transformation.
See #15189
This allows @import statements to be resolved in a set of user provided resources (e.g. from resources.FromString or css.ChromaStyles) before the assets filesystem.
The option also applies to css.PostCSS via the shared import inlining, and css.Sass requires the dartsass transpiler. The import context is part of the transformation cache key.
Fixes#15103
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This adds a new file cache named 'modulequeries' with a 24h maxAge
that caches JSON responses from 'go mod download -json' when querying
module versions with constraints (e.g., version = "<v3.0.0").
On subsequent builds, if the cached JSON exists and the module
directory it references is non-empty, the cached result is used
directly, skipping the costly VCS interaction entirely.
Fixes#14417
Note that we only use this for change detection.
The previous implementation invoked `MD5FromReaderFast` that created a MD5 has from 8 64 bytes chunks in the file, which is obviously very fast. The new implementation creates the hash from the entire file and ... seems to be even more effective:
```
name old time/op new time/op delta
HashImage-10 9.45µs ±21% 10.89µs ± 1% ~ (p=0.343 n=4+4)
name old alloc/op new alloc/op delta
HashImage-10 144B ± 0% 8B ± 0% -94.44% (p=0.029 n=4+4)
name old allocs/op new allocs/op delta
HashImage-10 4.00 ± 0% 1.00 ± 0% -75.00% (p=0.029 n=4+4)
```