Skip to content

Commit

Permalink
Allow result of load step to have map with binary data (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
canadaduane authored Oct 16, 2020
1 parent a71c152 commit 05fa08b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snowpack/src/build/build-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ async function runPipelineLoadStep(
const output = result[ext];

// normalize to {code, map} format
if (typeof output === 'string') result[ext] = {code: output};
if (typeof output === 'string' || Buffer.isBuffer(output)) {
result[ext] = {code: output};
}

// ensure source maps are strings (it’s easy for plugins to pass back a JSON object)
if (result[ext].map && typeof result[ext].map === 'object')
Expand Down

1 comment on commit 05fa08b

@vercel
Copy link

@vercel vercel bot commented on 05fa08b Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.