mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 12:52:31 +02:00
refactor(v2): use forked lqip-loader for performance (#1680)
This commit is contained in:
parent
1a5aed404e
commit
7f5c1ef581
4 changed files with 430 additions and 109 deletions
|
@ -21,9 +21,9 @@ module.exports = function(context, options) {
|
|||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(png|jpe?g|gif)$/,
|
||||
test: /\.(png|jpe?g|gif)$/i,
|
||||
use: [
|
||||
'lqip-loader',
|
||||
'@endiliey/lqip-loader',
|
||||
{
|
||||
loader: '@endiliey/responsive-loader',
|
||||
options: {
|
||||
|
@ -31,7 +31,9 @@ module.exports = function(context, options) {
|
|||
disable: !isProd,
|
||||
// eslint-disable-next-line
|
||||
adapter: require('@endiliey/responsive-loader/sharp'),
|
||||
name: 'ideal-img/[name].[hash:hex:7].[width].[ext]',
|
||||
name: isProd
|
||||
? 'ideal-img/[name].[hash:hex:7].[width].[ext]'
|
||||
: 'ideal-img/[name].[width].[ext]',
|
||||
...options,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue