Skip to content

Commit

Permalink
fix(Web): Exclude map files from embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Oct 9, 2021
1 parent 6938653 commit fd2ea89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion rust/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ pub fn serve_background(url: &str, key: Option<String>) -> Result<()> {
}

/// Static assets
///
/// During development, these are served from the `static` folder (which
/// has a symlink to `web/dist/browser` (and maybe in the future other folders).
/// At build time these are embedded in the binary. Use `include` and `exclude`
/// glob patterns to only include the assets that are required.
#[cfg(feature = "serve-static")]
#[derive(RustEmbed)]
#[folder = "static"]
#[exclude = "web/*.js.map"]
struct Static;

struct Client {
Expand Down Expand Up @@ -747,7 +753,7 @@ pub fn rewrite_html(body: &str, theme: &str, cwd: &Path, document: &Path) -> Str
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/~static/web/browser/index.js"></script>
<script src="/~static/web/index.js"></script>
<script>
const startup = stencilaWebClient.main("{url}", "{client}", "{project}", "{snapshot}", "{document}");
startup().catch((err) => console.error('Error during startup', err))
Expand Down
2 changes: 1 addition & 1 deletion rust/static/web

0 comments on commit fd2ea89

Please sign in to comment.