Macro include_js_codegen::include_js [−][src]
include_js!() { /* proc-macro */ }
Expand description
Simmilar to include_str!
from the stdlib but instead of including arbitrary files as &str
it includes sytactically valid javascript from files as &JSStr
. If the file contains invalid
Javascript you will get a compiletime error.
Note: The path must be relative to $CARGO_MANIFEST_DIR.
Examples
use include_js::{JSStr, include_js};
const JS: &JSStr = include_js!("src/js/some_script.js");