Skip to content

Commit

Permalink
docs: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulf committed Jan 1, 2025
1 parent 0ac05cb commit fc7050a
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ When you derive the `vite_rs::Embed` trait, some methods are generated for your
struct Assets;
```
### Release
#### In release builds:
- **GET ASSET**: Get an asset by its path. Fetches assets embedded into the binary.
Expand All @@ -178,9 +178,9 @@ struct Assets;
Assets::iter() -> impl Iterator<Item = Cow<'static, str>>
```
### Development
#### In development builds:
- **GET ASSET**: Get an asset by its path. Fetches assets from the dev server.
- **GET ASSET**: Get an asset by its path. Fetches assets from the dev server over HTTP.
```rust
Assets::get(path: &str) -> Option<vite_rs::ViteFile>
Expand All @@ -206,27 +206,6 @@ struct Assets;
Note: In development, you cannot iterate over all assets because there is no way to do so using the Vite dev server.
### Release
```rust
#[derive(vite_rs::Embed)]
struct Assets;
fn main() {
// Get an asset by its path
let asset = Assets::get("index.html"); // -> : Option<vite_rs::ViteFile>
// Get an iterator over all assets
let assets = Assets::iter(); // -> impl Iterator<Item = Cow<'static, str>>
// Start the ViteJS dev server
let guard: vite_rs::ViteProcess = Assets::start_dev_server(true);
// Stop the ViteJS dev server
Assets::stop_dev_server();
}
```
## Options
The derive macro (`#[vite_rs::Embed]`) supports the following options:
Expand Down

0 comments on commit fc7050a

Please sign in to comment.