trunk-rs / trunk

Build, bundle & ship your Rust WASM application to the web.

Home Page:https://trunkrs.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delay asset pipeline until rust build finished

lpotthast opened this issue · comments

My use case includes copying SCSS files through a libraries build.rs file into my application root directory.

Building the styles (SASS) will only work with the output from this build script.

But the asset pipeline always runs in parallel / can not be configured to run after a finished rust build. Errors in the SASS pipeline lead to a retry, also skipping/aborting the rust build, leading to no build.rs being executed an and endless retry-loop.

Could such an optional behavior be integrated into trunk?

A not-so-great workaround would be to add a “pre-build” hook that executes a cargo check to enforce running the build once.

Interesting. Right now, there isn't a real scheduler/dependency tree in the trunk build pipeline. However, there's another use case, where web-workers might have a dependency on each other, and the application being last (in order to inject env-vars with cache busting name).

Your use case looks like one more use case for having dependencies between different build steps.