mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: add section to help those bundling via Vite
This commit is contained in:
parent
26d0b7147d
commit
fc439bedf1
@ -249,6 +249,26 @@ option.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### vite
|
||||||
|
|
||||||
|
Ensure `sharp` is excluded from bundling via the
|
||||||
|
[build.rollupOptions](https://vitejs.dev/config/build-options.html)
|
||||||
|
configuration.
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: [
|
||||||
|
"sharp"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## TypeScript
|
## TypeScript
|
||||||
|
|
||||||
TypeScript definitions are published as part of
|
TypeScript definitions are published as part of
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user