mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
fix(ideal-image): Add issuer to ideal-image Webpack loader (#10910)
Some checks are pending
Argos CI / take-screenshots (push) Waiting to run
Build Hash Router / Build Hash Router (push) Waiting to run
Canary Release / Publish Canary (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Continuous Releases / Continuous Releases (push) Waiting to run
E2E Tests / E2E — Yarn v1 (18.0) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (20) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (22) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Waiting to run
E2E Tests / E2E — npm (push) Waiting to run
E2E Tests / E2E — pnpm (push) Waiting to run
Some checks are pending
Argos CI / take-screenshots (push) Waiting to run
Build Hash Router / Build Hash Router (push) Waiting to run
Canary Release / Publish Canary (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Continuous Releases / Continuous Releases (push) Waiting to run
E2E Tests / E2E — Yarn v1 (18.0) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (20) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (22) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Waiting to run
E2E Tests / E2E — npm (push) Waiting to run
E2E Tests / E2E — pnpm (push) Waiting to run
This commit is contained in:
parent
3fde4a0d6a
commit
cd2792775e
|
|
@ -54,6 +54,12 @@ export default function pluginIdealImage(
|
|||
rules: [
|
||||
{
|
||||
test: /\.(?:png|jpe?g)$/i,
|
||||
// We don't want to use the image loader for non-React source code
|
||||
// ie we don't want to use ideal image loader for CSS files...
|
||||
// See https://github.com/facebook/docusaurus/issues/10862
|
||||
issuer: {
|
||||
and: [/\.(?:tsx?|jsx?|mdx?)$/i],
|
||||
},
|
||||
use: [
|
||||
require.resolve('@docusaurus/lqip-loader'),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.dogfood-image-test-css {
|
||||
background-image: url('./img/oss_logo.png');
|
||||
background-size: contain;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
|
@ -2,7 +2,7 @@
|
|||
image: ./img/oss_logo.png
|
||||
---
|
||||
|
||||
# Image tests
|
||||
# Image Tests
|
||||
|
||||
import Image from '@theme/IdealImage';
|
||||
|
||||
|
|
@ -14,6 +14,8 @@ export const docusaurusRequire = require('@site/static/img/docusaurus.png');
|
|||
|
||||
## Regular images
|
||||
|
||||
Those only render in DEV when IdealImage plugin is disabled.
|
||||
|
||||
<img src={docusaurusImport} />
|
||||
|
||||
<img src={docusaurusRequire.default} />
|
||||
|
|
@ -23,3 +25,13 @@ export const docusaurusRequire = require('@site/static/img/docusaurus.png');
|
|||
<Image img={docusaurusImport} />
|
||||
|
||||
<Image img={docusaurusRequire} />
|
||||
|
||||
## CSS Image
|
||||
|
||||
import './img-tests.css';
|
||||
|
||||
This should display a div with have a background image
|
||||
|
||||
<div
|
||||
className="dogfood-image-test-css"
|
||||
style={{border: 'solid', height: '10rem'}}></div>
|
||||
Loading…
Reference in New Issue