static-dev / spike-core

:warning: UNMAINTAINED :warning: A modern static build tool, powered by webpack
https://spike.js.org
Other
58 stars 9 forks source link

Binary File Issues #143

Closed jescalan closed 8 years ago

jescalan commented 8 years ago

Ok so this issue is a nasty one, and has only come up occasionally and on certain machines. But sometimes the source loader will throw some error about an unterminated string, and not copy a static file to the output folder. My theory of why this is the case is that JSON.stringify is choking on large and/or unusual binary file contents here in source-loader.

This line that stringifies and exports is intended for text files, and doesn't really do anything for a binary file, except for return a massive string of unusable gibberish. So I'd propose that we do our best to detect some common types of binary files, and if we are able to, handle them in a different way. (Another option as suggested by @kylemac)

Here's what I'm thinking as far as alternate handling for binary files:

Any thoughts?

jescalan commented 8 years ago

Confirmed fixed by an update to source-loader 🎉