Skip to content

Commit

Permalink
fix(gatsby-plugin-sass): fix default output style & allow unknown opt…
Browse files Browse the repository at this point in the history
…ions (#27822)
  • Loading branch information
mxstbr authored Nov 4, 2020
1 parent 5f8beb7 commit decd4ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/gatsby-plugin-sass/src/__tests__/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
3 changes: 1 addition & 2 deletions packages/gatsby-plugin-sass/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}

0 comments on commit decd4ff

Please sign in to comment.