Skip to content

Commit

Permalink
add warning for Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Jan 2, 2025
1 parent ceb6794 commit 365a7b9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/scrcpy/prepare-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ const server: ArrayBuffer = await fetch(BIN).then((res) => res.arrayBuffer());
</TabItem>
<TabItem label="Vite" value="vite">

:::warning

Vite's dependency "optimizer" will break this package: https://github.com/vitejs/vite/issues/8427

Add this to your `vite.config.js`/`vite.config.ts`:

```js
import { defineConfig } from "vite";

export default defineConfig({
optimizeDeps: {
exclude: ["@yume-chan/fetch-scrcpy-server"],
},
});
```

:::

```ts transpile
import { BIN, VERSION } from "@yume-chan/fetch-scrcpy-server";

Expand Down
24 changes: 24 additions & 0 deletions docs/scrcpy/video/tiny-h264.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ It's slow, and only supports H.264 main profile at level 4, but works on most br
npm install @yume-chan/scrcpy-decoder-tinyh264
```

:::warning

Vite's dependency "optimizer" will break this package: https://github.com/vitejs/vite/issues/8427

Add this to your `vite.config.js`/`vite.config.ts`:

```js
import { defineConfig } from "vite";

export default defineConfig({
optimizeDeps: {
exclude: [
"@yume-chan/scrcpy-decoder-tinyh264",
],
include: [
"@yume-chan/scrcpy-decoder-tinyh264 > yuv-buffer",
"@yume-chan/scrcpy-decoder-tinyh264 > yuv-canvas",
],
},
});
```

:::

## Performance

There are two aspects of performance:
Expand Down

0 comments on commit 365a7b9

Please sign in to comment.