mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 23:40:39 +02:00
docs(v2): mention that plugin-ideal-image
only perform compression on a production build (#2572)
* Add a note that `plugin-ideal-image` only perform compression on a production build. In reference to https://github.com/facebook/docusaurus/issues/2571 * Update using-plugins.md * Update using-plugins.md * Update using-plugins.md Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
This commit is contained in:
parent
dcf91ebfe4
commit
a8ab0d661e
2 changed files with 9 additions and 10 deletions
|
@ -403,7 +403,7 @@ module.exports = {
|
|||
|
||||
### `@docusaurus/plugin-ideal-image`
|
||||
|
||||
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder)
|
||||
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder) **in the production builds**.
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save @docusaurus/plugin-ideal-image
|
||||
|
@ -411,18 +411,17 @@ npm install --save @docusaurus/plugin-ideal-image
|
|||
|
||||
Modify your `docusaurus.config.js`
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
```diff
|
||||
module.exports = {
|
||||
// ...
|
||||
// highlight-next-line
|
||||
plugins: ['@docusaurus/plugin-ideal-image'],
|
||||
// ...
|
||||
};
|
||||
...
|
||||
+ plugins: ['@docusaurus/plugin-ideal-image'],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
||||
This plugin supports png, gif and jpg only
|
||||
This plugin supports the PNG, GIF and JPG formats only.
|
||||
|
||||
```jsx
|
||||
import Image from '@theme/IdealImage';
|
||||
|
|
|
@ -394,7 +394,7 @@ module.exports = {
|
|||
|
||||
### `@docusaurus/plugin-ideal-image`
|
||||
|
||||
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder)
|
||||
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder) **in the production builds**.
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save @docusaurus/plugin-ideal-image
|
||||
|
@ -412,7 +412,7 @@ module.exports = {
|
|||
|
||||
#### Usage
|
||||
|
||||
This plugin supports png, gif and jpg only
|
||||
This plugin supports the PNG, GIF and JPG formats only.
|
||||
|
||||
```jsx
|
||||
import Image from '@theme/IdealImage';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue