Created
August 26, 2018 08:47
-
-
Save Yoplitein/ab42066b7a86cc3cd07763935bf68285 to your computer and use it in GitHub Desktop.
Webpack loader for binary files (doesn't munge content by storing in strings)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
module.exports = function(source) | |
{ | |
const buffer = fs.readFileSync(this.resourcePath) | |
return `module.exports = Uint8Array.from([${buffer.toJSON().data}]);`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment