diff --git a/bin/src/run/index.js b/bin/src/run/index.js index d6fd20a9cc7..0b986b505e0 100644 --- a/bin/src/run/index.js +++ b/bin/src/run/index.js @@ -64,6 +64,8 @@ export default function runRollup ( command ) { configFile = realpathSync( configFile ); } + if (command.watch) process.env.ROLLUP_WATCH = 'true'; + loadConfigFile(configFile, command.silent) .then(normalized => execute( configFile, normalized, command )) .catch(handleError); @@ -74,7 +76,6 @@ export default function runRollup ( command ) { function execute ( configFile, configs, command ) { if ( command.watch ) { - process.env.ROLLUP_WATCH = 'true'; watch( configFile, configs, command, command.silent ); } else { return sequence( configs, config => {