mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-16 22:38:14 +00:00
Move build files into build-conf and rename to build-utils
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
9
build-utils/fix-jsonstream.js
Normal file
9
build-utils/fix-jsonstream.js
Normal file
@ -0,0 +1,9 @@
|
||||
// JSONStream is a hybrid executable-library
|
||||
// and has a #! /usr/bin/env node at the beginning of the file.
|
||||
// This webpack loader removes it so that we have valid javascript for webpack to load.
|
||||
// Also, JSONStream starts a pipe between stdin and stdout if module.parent is undefined.
|
||||
// This pipe can fail throwing an uncaught exception, so we fake a module.parent to prevent this.
|
||||
// See https://github.com/dominictarr/JSONStream/issues/129
|
||||
module.exports = function(source) {
|
||||
return 'module.parent = {};\n' + source.toString().replace(/^#! .*\n/, '');
|
||||
};
|
Reference in New Issue
Block a user