parent
54a692ae33
commit
b76da24dcd
2 changed files with 9 additions and 8 deletions
|
@ -6,7 +6,6 @@
|
|||
var gulp = require('gulp');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var os = require('os');
|
||||
var es = require('event-stream');
|
||||
var azure = require('gulp-azure-storage');
|
||||
var electron = require('gulp-atom-electron');
|
||||
|
@ -202,10 +201,11 @@ function packageTask(platform, arch, opts) {
|
|||
.map(function (d) { return ['node_modules/' + d + '/**', '!node_modules/' + d + '/**/{test,tests}/**']; }));
|
||||
|
||||
var deps = gulp.src(depsSrc, { base: '.', dot: true })
|
||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], true))
|
||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], true))
|
||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], true))
|
||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], true));
|
||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('pty.js', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/**']));
|
||||
|
||||
var all = es.merge(
|
||||
api,
|
||||
|
|
|
@ -183,7 +183,7 @@ exports.skipDirectories = function () {
|
|||
});
|
||||
};
|
||||
|
||||
exports.cleanNodeModule = function (name, excludes, isNative) {
|
||||
exports.cleanNodeModule = function (name, excludes, includes) {
|
||||
var glob = function (path) { return '**/node_modules/' + name + (path ? '/' + path : ''); };
|
||||
var negate = function (str) { return '!' + str; };
|
||||
|
||||
|
@ -194,8 +194,9 @@ exports.cleanNodeModule = function (name, excludes, isNative) {
|
|||
var nodeModuleInput = input.pipe(allFilter);
|
||||
var output = nodeModuleInput.pipe(filter(globs));
|
||||
|
||||
if (isNative) {
|
||||
output = es.merge(output, nodeModuleInput.pipe(filter(glob('**/*.node'))));
|
||||
if (includes) {
|
||||
var includeGlobs = includes.map(glob);
|
||||
output = es.merge(output, nodeModuleInput.pipe(filter(includeGlobs)));
|
||||
}
|
||||
|
||||
output = output.pipe(allFilter.restore);
|
||||
|
|
Loading…
Reference in a new issue