Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Mar 20, 2019
1 parent 6ffe655 commit f235e9e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/gatsby-plugin-sharp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,20 +704,26 @@ async function notMemoizedtraceSVG({ file, args, fileArgs, reporter }) {

await new Promise(resolve =>
pipeline.toFile(tmpFilePath, (err, info) => {
if (err) {
console.log(`THERE IS ERROR HERE!!!!`, err)
}
// console.log(`i`, { info, fileArgs, args })
resolve()
})
)

return trace(tmpFilePath, optionsSVG)
.then(svg => optimize(svg))
.then(svg => svgToMiniDataURI(svg))
// .then(svg => optimize(svg))
// .then(svg => svgToMiniDataURI(svg))
}

const memoizedTraceSVG = _.memoize(
const memoizedTraceSVG = notMemoizedtraceSVG
/*
_.memoize(
notMemoizedtraceSVG,
({ file, args }) => `${file.absolutePath}${JSON.stringify(args)}`
)

*/
async function traceSVG(args) {
return await memoizedTraceSVG(args)
}
Expand Down

0 comments on commit f235e9e

Please sign in to comment.