diff --git a/scripts/build.js b/scripts/build.js index 7bbba5ee4..0cd13e0a9 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -56,10 +56,14 @@ function afterBuild(options) { */ function build(options) { - var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat( - ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) { - return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join(''); - })).concat(options.args); + var libargs = []; + ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].forEach(function(subject) { + var env = process.env[subject.toUpperCase()]; + if (env != null) libargs.push(['--', subject, '=', env].join('')); + }); + var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'] + .concat(libargs) + .concat(options.args); console.log('Building:', [process.execPath].concat(args).join(' '));