Stencil で構築している Web コンポーネントに画像を挿入しようとしています。
2 つのエラーが発生します。
AppLogo is declared but its value is never read.
と
Cannot find module ../assets/logo.svg.
ディレクトリ:
- src
-- components
--- app-header
---- assets
----- logo.svg
---- app-header.tsx
---- app-header.scss
---- app-header.spec.ts
コード:
import { Component } from "@stencil/core";
import AppLogo from "../assets/logo.svg";
@Component({
tag: "app-header",
styleUrl: "app-header.scss"
})
export class AppHeader {
render() {
return (
<header class="app-header">
<a href="#" class="app-logo">
<img src="{AppLogo}" alt="App Name" />
</a>
</header>
);
}
}
これに関する大量のドキュメントはありません (私が見つけることができます)。だから、どんな助けも大歓迎です。