From e0afb814aa47ccdfb2e0597ca44e009274fd3b0f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 3 Nov 2016 13:54:08 -0700 Subject: [PATCH 1/2] Only call browserify when one of sandbox sources change --- electron.gyp | 6 +----- filenames.gypi | 1 + lib/renderer/api/ipc-renderer-setup.js | 3 +++ lib/sandboxed_renderer/init.js | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/electron.gyp b/electron.gyp index 8f7ce4f3b85b..0854c5e5d886 100644 --- a/electron.gyp +++ b/electron.gyp @@ -436,10 +436,6 @@ 'action_name': 'atom_browserify', 'inputs': [ '<@(browserify_entries)', - # Any js file under `lib/` can be included in the preload bundle. - # Add all js sources as dependencies so any change to a js file will - # trigger a rebuild of the bundle(and consequently of js2c). - '<@(js_sources)', ], 'outputs': [ '<(js2c_input_dir)/preload_bundle.js', @@ -449,7 +445,7 @@ 'run', 'browserify', '--', - '<@(browserify_entries)', + 'lib/sandboxed_renderer/init.js', '-o', '<@(_outputs)', ], diff --git a/filenames.gypi b/filenames.gypi index 68b58b04f7ab..9197fc4d0a32 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -73,6 +73,7 @@ 'lib/renderer/extensions/web-navigation.js', ], 'browserify_entries': [ + 'lib/renderer/api/ipc-renderer-setup.js', 'lib/sandboxed_renderer/init.js', ], 'js2c_sources': [ diff --git a/lib/renderer/api/ipc-renderer-setup.js b/lib/renderer/api/ipc-renderer-setup.js index c4459df2bf48..76fdbb5f0e52 100644 --- a/lib/renderer/api/ipc-renderer-setup.js +++ b/lib/renderer/api/ipc-renderer-setup.js @@ -1,3 +1,6 @@ +// Any requires added here need to be added to the browserify_entries array +// in filenames.gypi so they get built into the preload_bundle.js bundle + module.exports = function (ipcRenderer, binding) { ipcRenderer.send = function (...args) { return binding.send('ipc-message', args) diff --git a/lib/sandboxed_renderer/init.js b/lib/sandboxed_renderer/init.js index e34b7bc70759..bc0855527f0e 100644 --- a/lib/sandboxed_renderer/init.js +++ b/lib/sandboxed_renderer/init.js @@ -1,3 +1,6 @@ +// Any requires added here need to be added to the browserify_entries array +// in filenames.gypi so they get built into the preload_bundle.js bundle + /* eslint no-eval: "off" */ /* global binding, preloadPath, process, Buffer */ const events = require('events') From 3e34760eef74e7b1860c56ed4771da2d55a80596 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 3 Nov 2016 14:07:01 -0700 Subject: [PATCH 2/2] Run browserify with --silent --- electron.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/electron.gyp b/electron.gyp index 0854c5e5d886..80324d4e726b 100644 --- a/electron.gyp +++ b/electron.gyp @@ -443,6 +443,7 @@ 'action': [ 'npm', 'run', + '--silent', 'browserify', '--', 'lib/sandboxed_renderer/init.js',