From fd7aa2bf324ec8dad5a84bb17153e3241a66701d Mon Sep 17 00:00:00 2001 From: slorber Date: Fri, 30 Apr 2021 11:29:49 +0200 Subject: [PATCH] fix ideal-image warning due to missing hash: > Conflict: Multiple assets emit different content to the same filename assets/ideal-img/datagit.100.png see https://github.com/facebook/docusaurus/pull/4089#discussion_r622013656 --- packages/docusaurus-plugin-ideal-image/src/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus-plugin-ideal-image/src/index.ts b/packages/docusaurus-plugin-ideal-image/src/index.ts index b1e91b0628c0..6b0b46444968 100644 --- a/packages/docusaurus-plugin-ideal-image/src/index.ts +++ b/packages/docusaurus-plugin-ideal-image/src/index.ts @@ -32,10 +32,6 @@ export default function ( rules: [ { test: /\.(png|jpe?g)$/i, - type: 'javascript/auto', - generator: { - emit: !isServer, - }, use: [ require.resolve('@docusaurus/lqip-loader'), { @@ -44,9 +40,8 @@ export default function ( emitFile: !isServer, // don't emit for server-side rendering disable: !isProd, adapter: require('@docusaurus/responsive-loader/sharp'), - name: isProd - ? 'assets/ideal-img/[name].[hash:hex:7].[width].[ext]' - : 'assets/ideal-img/[name].[width].[ext]', + name: + 'assets/ideal-img/[name].[contenthash:8].[width].[ext]', ...options, }, },