1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#![doc(test(no_crate_inject))]
/*!
# static-files - the library to help automate static resource collection

## Legal

Dual-licensed under `MIT` or the [UNLICENSE](http://unlicense.org/).

## Features

- Embed static resources in executuble
- Install dependencies with [npm](https://npmjs.org) package manager
- Run custom `npm` run commands (such as [webpack](https://webpack.js.org/))
- Support for npm-like package managers ([yarn](https://yarnpkg.com/))
- Change detection support to reduce compilation time

## Usage

Create folder with static resources in your project (for example `static`):

```bash
cd project_dir
mkdir static
echo "Hello, world" > static/hello
```

Add to `Cargo.toml` dependency to `static-files`:

```toml
[dependencies]
static-files = "0.2"

[build-dependencies]
static-files = "0.2"
```

Add `build.rs` with call to bundle resources:

```rust#ignore
use static_files::resource_dir;

fn main() -> std::io::Result<()> {
    resource_dir("./static").build()?;
}
```

Include generated code in `main.rs`:

```rust#ignore
include!(concat!(env!("OUT_DIR"), "/generated.rs"));

fn main() -> std::io::Result<()> {
    let generated = generate(); // <-- this function is defined in generated.rs
    ...
}
```
*/

mod mods;

pub use mods::{
    npm_build::{npm_resource_dir, NpmBuild},
    resource::{self, Resource},
    resource_dir::{resource_dir, ResourceDir},
    sets,
};