fix(ideal-image): fix IdealImage in dev not handling ES import images properly (#5760)

This commit is contained in:
Sébastien Lorber 2021-10-21 17:22:49 +02:00 committed by GitHub
parent 1c8b8362f7
commit 31ad8c4def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 2 deletions

View file

@ -0,0 +1,19 @@
# Image tests
import Image from '@theme/IdealImage';
import docusaurusImport from '@site/static/img/docusaurus.png';
export const docusaurusRequire = require('@site/static/img/docusaurus.png');
## Regular images
<img src={docusaurusImport} />
<img src={docusaurusRequire.default} />
## Ideal images
<Image img={docusaurusImport} />
<Image img={docusaurusRequire} />

View file

@ -13,6 +13,16 @@ module.exports = {
className: 'red',
label: 'Index',
},
{
type: 'category',
label: 'Tests',
items: [
{
type: 'autogenerated',
dirName: 'tests',
},
],
},
{
type: 'category',
label: 'section',