iced-rs / iced_web

A web runtime for iced that targets the DOM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update README to suggest using trunk to build for web

Person-93 opened this issue · comments

I used trunk to serve the tour package and had no issues. I just put this html file into the package root and ran trunk serve.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>Trunk of ice</title>
    <base data-trunk-public-url/>
</head>
<body>
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-bin="tour"/>
</body>
</html>

$ trunk serve
Jan 16 12:55:57.724 INFO 📦 starting build
Jan 16 12:55:57.725 INFO spawning asset pipelines
Jan 16 12:55:57.916 INFO building iced
error: no bin target named tour
Jan 16 12:55:58.031 ERROR ❌ error
error from HTML pipeline

Caused by:
0: error from asset pipeline
1: error during cargo build execution
2: cargo call returned a bad status
Jan 16 12:55:58.031 INFO 📡 serving static assets at -> /
Jan 16 12:55:58.032 INFO 📡 server listening at 0.0.0.0:8080

Needs to be as index.html in examples/tour.
Then trunk serve there.

images/ferris.png does not load.