Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix bad alias usage in assets examples #1443

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions docs/guide/essentials/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ img.src = imageUrl;
```

```html [HTML]
<img src="~/assets/image.png" />
<!-- In HTML tags, you must use the relative path --->
<img src="../assets/image.png" />
```

```css [CSS]
Expand All @@ -25,6 +26,22 @@ img.src = imageUrl;
}
```

```vue [Vue]
<script>
import image from '~/assets/image.png';
</script>

<template>
<img :src="image" />
</template>
```

```jsx [JSX]
import image from '~/assets/image.png';

<img src={image} />;
```

:::

## `/public` Directory
Expand Down Expand Up @@ -52,6 +69,16 @@ img.src = imageUrl;
}
```

```vue [Vue]
<template>
<img src="/image.png" />
</template>
```

```jsx [JSX]
<img src="/image.png" />
```

:::

## Inside Content Scripts
Expand Down Expand Up @@ -114,7 +141,7 @@ export default defineConfig({
manifest: {
web_accessible_resources: [
{
// We'll use this matches in the cotent script as well
// We'll use this matches in the content script as well
matches: ['*://*.github.com/*'],
// Use the same path as `relativeDest` from the WXT module
resources: ['/oxc_parser_wasm_bg.wasm'],
Expand Down