From decd4ff5ea73ba2706e4034f3a1f8e089c4cc31e Mon Sep 17 00:00:00 2001 From: Max Stoiber Date: Wed, 4 Nov 2020 11:30:26 +0100 Subject: [PATCH] fix(gatsby-plugin-sass): fix default output style & allow unknown options (#27822) --- packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js | 8 ++++++++ packages/gatsby-plugin-sass/src/gatsby-node.js | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js b/packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js index 7f96d5a1fad3e..ffca2e3e8dc4f 100644 --- a/packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js +++ b/packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js @@ -152,4 +152,12 @@ describe(`pluginOptionsSchema`, () => { expect(isValid).toBe(true) }) + + it(`should allow unknown options`, async () => { + const { isValid } = await testPluginOptionsSchema(pluginOptionsSchema, { + webpackImporter: `unknown option`, + }) + + expect(isValid).toBe(true) + }) }) diff --git a/packages/gatsby-plugin-sass/src/gatsby-node.js b/packages/gatsby-plugin-sass/src/gatsby-node.js index e5df5a9749eb4..cf5b8ae924da6 100644 --- a/packages/gatsby-plugin-sass/src/gatsby-node.js +++ b/packages/gatsby-plugin-sass/src/gatsby-node.js @@ -166,7 +166,6 @@ exports.pluginOptionsSchema = function ({ Joi }) { ), outputStyle: Joi.string() .valid(`nested`, `expanded`, `compact`, `compressed`) - .default(`nested`) .description(`Determines the output format of the final CSS style.`), precision: Joi.number() .default(5) @@ -193,5 +192,5 @@ When typeof sourceMap === "string", the value of sourceMap will be used as the w sourceMapRoot: Joi.string().description( `the value will be emitted as sourceRoot in the source map information` ), - }) + }).unknown(true) }