@@ -62,19 +62,21 @@ exports.onPreBootstrap = ({ actions, emitter, reporter }, pluginOptions) => {
62
62
// normalizedOptions = setPluginOptions(pluginOptions)
63
63
}
64
64
65
- exports . pluginOptionsSchema = ( { Joi } ) =>
66
- Joi . object ( {
67
- base64Width : Joi . number ( )
68
- . default ( 20 )
69
- . description ( `The width of the generated base64 preview image` ) ,
70
- forceBase64Format : Joi . any ( )
71
- . valid ( `png` , `jpg` , `webp` )
72
- . description (
73
- `Force a different format for the generated base64 image. Defaults to the same format as the input image`
65
+ if ( process . env . GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION ) {
66
+ exports . pluginOptionsSchema = ( { Joi } ) =>
67
+ Joi . object ( {
68
+ base64Width : Joi . number ( )
69
+ . default ( 20 )
70
+ . description ( `The width of the generated base64 preview image` ) ,
71
+ forceBase64Format : Joi . any ( )
72
+ . valid ( `png` , `jpg` , `webp` )
73
+ . description (
74
+ `Force a different format for the generated base64 image. Defaults to the same format as the input image`
75
+ ) ,
76
+ useMozJpeg : Joi . boolean ( ) . description (
77
+ `The the mozJpeg library for encoding. Defaults to false, unless \`process.env.GATSBY_JPEG_ENCODER\` === \`MOZJPEG\``
74
78
) ,
75
- useMozJpeg : Joi . boolean ( ) . description (
76
- `The the mozJpeg library for encoding. Defaults to false, unless \`process.env.GATSBY_JPEG_ENCODER\` === \`MOZJPEG\``
77
- ) ,
78
- stripMetadata : Joi . boolean ( ) . default ( true ) ,
79
- defaultQuality : Joi . number ( ) . default ( 50 ) ,
80
- } )
79
+ stripMetadata : Joi . boolean ( ) . default ( true ) ,
80
+ defaultQuality : Joi . number ( ) . default ( 50 ) ,
81
+ } )
82
+ }
0 commit comments