inpm-impl

Crates.ioinpm-impl
lib.rsinpm-impl
version0.2.1
sourcesrc
created_at2020-05-13 08:49:03.203218
updated_at2020-05-13 12:52:14.803183
descriptionInlude npm
homepage
repositoryhttps://github.com/lperlaki/inpm-rs
max_upload_size
id241027
size7,958
Liam Perlaki (lperlaki)

documentation

README

Inlucde NPM

Include Static npm build ouput in your rust binary

When you compile in debug mode the File contents will just be read from disk and not embedded. This can manually be overriden with the embed feautere.

const ASSETS: inpm::Dir = inpm::include_package!("./client/dist");


let content_of_my_file = ASSETS.get("some_dir/my_file.txt").contents();

Warp feature

features=["warp"]

const ASSETS: inpm::Dir = inpm::include_package!("./client/dist");


let my_file_filter = inpm::warp::embedded(ASSETS);

// Allso works with single page applications

let my_spa_filter = inpm::warp::spa(ASSETS, "index.html");


Commit count: 12

cargo fmt