Skip to content

Commit 222920b

Browse files
authored
fix: do not augment plugin-options (#26006)
1 parent 1b16e07 commit 222920b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/gatsby-plugin-sharp/src/trace-svg.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ exports.notMemoizedtraceSVG = async ({ file, args, fileArgs, reporter }) => {
130130
turnPolicy: potrace.Potrace.TURNPOLICY_MAJORITY,
131131
}
132132

133-
const optionsSVG = _.defaults(args, defaultArgs)
133+
const optionsSVG = _.defaults({}, args, defaultArgs)
134134

135135
// `srcset` attribute rejects URIs with literal spaces
136136
const encodeSpaces = str => str.replace(/ /gi, `%20`)

packages/gatsby-remark-copy-linked-files/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = (
8585
if (!validateDestinationDir(destinationDir))
8686
return Promise.reject(invalidDestinationDirMessage(destinationDir))
8787

88-
const options = _.defaults(pluginOptions, defaults)
88+
const options = _.defaults({}, pluginOptions, defaults)
8989

9090
const filesToCopy = new Map()
9191
// Copy linked files to the destination directory and modify the AST to point

packages/gatsby-remark-images-contentful/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = async (
5858

5959
const srcSplit = node.url.split(`/`)
6060
const fileName = srcSplit[srcSplit.length - 1]
61-
const options = _.defaults(pluginOptions, defaults)
61+
const options = _.defaults({}, pluginOptions, defaults)
6262

6363
const optionsHash = createContentDigest(options)
6464

packages/gatsby-remark-images/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = (
3535
},
3636
pluginOptions
3737
) => {
38-
const options = _.defaults(pluginOptions, { pathPrefix }, DEFAULT_OPTIONS)
38+
const options = _.defaults({}, pluginOptions, { pathPrefix }, DEFAULT_OPTIONS)
3939

4040
const findParentLinks = ({ children }) =>
4141
children.some(

packages/gatsby-remark-responsive-iframe/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = async ({ markdownAST }, pluginOptions = {}) => {
2626
const defaults = {
2727
wrapperStyle: ``,
2828
}
29-
const options = _.defaults(pluginOptions, defaults)
29+
const options = _.defaults({}, pluginOptions, defaults)
3030
visit(markdownAST, [`html`, `jsx`], node => {
3131
const $ = cheerio.load(node.value)
3232
const iframe = $(`iframe, object`)

0 commit comments

Comments
 (0)