static-files - the library to help automate static resource collection
Legal
Dual-licensed under MIT
or the UNLICENSE.
Features
- Embed static resources in executuble
- Install dependencies with npm package manager
- Run custom
npm
run commands (such as webpack) - Support for npm-like package managers (yarn)
- Change detection support to reduce compilation time
Usage
Create folder with static resources in your project (for example static
):
Add to Cargo.toml
dependency to static-files
:
[]
= "0.3"
[]
= "0.3"
Add build.rs
with call to bundle resources:
use resource_dir;
Include generated code in main.rs
:
include!;
By default, 'static-files' collects all files in operation system defined order, but you can change it by activating 'sort' feature in Cargo.toml
:
[]
= { = "0.3", = ["sort"] }
[]
= { = "0.3", = ["sort"] }