diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index 60a88411a..df2c19d3a 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.js @@ -5,7 +5,10 @@ * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow */ + 'use strict'; const log = require('../util/log').out('bundle'); @@ -17,7 +20,8 @@ const path = require('path'); const saveAssets = require('./saveAssets'); const defaultAssetExts = require('../../packager/defaults').assetExts; -import type RequestOptions from './types.flow'; +import type {RequestOptions, OutputOptions} from './types.flow'; +import type {ConfigT} from '../util/Config'; function saveBundle(output, bundle, args) { return Promise.resolve( @@ -25,7 +29,17 @@ function saveBundle(output, bundle, args) { ).then(() => bundle); } -function buildBundle(args, config, output = outputBundle, packagerInstance) { +function buildBundle( + args: OutputOptions & { + assetsDest: mixed, + entryFile: string, + resetCache: boolean, + transformer: string, + }, + config: ConfigT, + output = outputBundle, + packagerInstance, +) { // This is used by a bazillion of npm modules we don't control so we don't // have other choice than defining it as an env variable here. process.env.NODE_ENV = args.dev ? 'development' : 'production';