Struct web_bundler::WebBundlerOpt [−][src]
Bundles a Seed SPA web application for publishing
- This script will run wasm-pack for the indicated crate.
- An index.html file will be read from the src_dir, and processed with the Tera templating engine.
- The .wasm file is versioned.
- Files in ./static are copied to the output without modification.
- Files with a .scss extension in ./css are compiled to css.
Example index.html
<!DOCTYPE html>
<html lang="en">
<head>
<base href="{{ base_url }}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ stylesheet | safe }}
<title>My Amazing Website</title>
</head>
<body>
<div id="app"></div>
{{ javascript | safe }}
</body>
</html>
Fields
src_dir: PathBuf
Where to look for input files. Usually the root of the SPA crate.
dist_dir: PathBuf
The directory where output should be written to. In build.rs scripts, this should be read from the "OUT_DIR" environment variable.
tmp_dir: PathBuf
A directory that web-bundler can use to store temporary artifacts.
base_url: Option<String>
Passed into the index.html template as base_url. Example template usage: <base href="{{ base_url }}">
wasm_version: String
Rename the webassembly bundle to include this version number.
release: bool
Build in release mode, instad of debug mode.
workspace_root: PathBuf
Path to the root of the workspace. A new target directory, called 'web-target' is placed there. If you aren't using a workspace, this can be wherever your target
directory lives.
additional_watch_dirs: Vec<PathBuf>
Any additional directories that, if changes happen here, a rebuild is required.
Auto Trait Implementations
impl RefUnwindSafe for WebBundlerOpt
[src]
impl Send for WebBundlerOpt
[src]
impl Sync for WebBundlerOpt
[src]
impl Unpin for WebBundlerOpt
[src]
impl UnwindSafe for WebBundlerOpt
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,