<p dir="auto">I have a webpack configs for two builds with  <code class="notranslate">watch: true</code> options.<br>
If I try <code class="notranslate">module.exports = {/*1st build*/}</code> or <code class="notranslate">module.exports = {/*2st build*/}</code> everything is fine.<br>
But when I try to combine them into one like this:<br>
<code class="notranslate">module.exports = [{/*1st build*/},{/*2d build*/}]</code><br>
and run <code class="notranslate">webpack</code> command it doesn't watch for changes. It just stops working like there is no <code class="notranslate">watch: true</code> option there.<br>
But if I run <code class="notranslate">webpack --watch</code> it works and watches for changes.</p>
<p dir="auto">Shouldn't those <code class="notranslate">watch: true</code> options work from inside the config? Or is <code class="notranslate">webpack --watch</code> the only way to do it?</p>
<h1 dir="auto">I'm submitting a...</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> bug report</li>
</ul>
<p dir="auto"><strong>Webpack version:</strong><br>
1.13.1/2.x</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
OSX 10.11.5</p>
<p dir="auto"><strong>Current behavior:</strong><br>
If webpack.config exports an array watch param doesn't work</p>
<p dir="auto"><strong>Expected/desired behavior:</strong><br>
If webpack.config exports an array, watch param should work</p>
<p dir="auto"><strong>Webpack configuration:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module.exports = [
    {
        entry: entries,

        output: {
            path: __dirname + '/www/f/min/',
            filename: '[name].build.js',
            publicPath: '/rev-18/f/min/',
        },

        watch: true,

        watchOptions: {
            aggregateTimeout: 150
        },

        devtool: 'source-map',

        resolve: {
            modulesDirectories: ['node_modules'],
            extensions: ['', '.js'],
            alias
        },

        resolveLoader: {
            modulesDirectories: ['node_modules'],
            moduleTemplates: ['*-loader', '*'],
            extensions: ['', '.js']
        },

        module: {
            loaders: [
                {
                    test: /\.js$/,
                    exclude: /(node_modules|bower_components|nform)/,
                    loader: 'babel',
                    query: {
                        plugins: ['transform-runtime'],
                        presets: ['es2015', 'stage-0']
                    }
                },
                {
                    test: /\.modernizrrc$/,
                    loader: 'modernizr'
                },
            ],
        },

        stats: {
            children: false
        },

        plugins: [
            new webpack.NoErrorsPlugin(),
            new webpack.optimize.CommonsChunkPlugin({
                name: 'common',
                minChunks: 4
            }),
        ]
    },
    {
        entry: entriesLess,

        output: {
            path: __dirname + '/www/f/min/',
            filename: '[name].build.css'
        },

        watch: true,

        watchOptions: {
            aggregateTimeout: 150
        },

        resolveLoader: {
            modulesDirectories: ['node_modules'],
            moduleTemplates: ['*-loader', '*'],
            extensions: ['', '.js']
        },

        module: {
            loaders: [
                {
                    test: /modules\/.*\.less$/,
                    loader: ExtractTextPlugin.extract('style', 'css?-url!postcss!less')
                },
            ]
        },

        postcss: function () {
            return [cssnext]
        },

        stats: {
            children: false
        },

        plugins: [
            new webpack.NoErrorsPlugin(),
            new ExtractTextPlugin('[name].build.css')
        ]
    }
];"><pre class="notranslate"><code class="notranslate">module.exports = [
    {
        entry: entries,

        output: {
            path: __dirname + '/www/f/min/',
            filename: '[name].build.js',
            publicPath: '/rev-18/f/min/',
        },

        watch: true,

        watchOptions: {
            aggregateTimeout: 150
        },

        devtool: 'source-map',

        resolve: {
            modulesDirectories: ['node_modules'],
            extensions: ['', '.js'],
            alias
        },

        resolveLoader: {
            modulesDirectories: ['node_modules'],
            moduleTemplates: ['*-loader', '*'],
            extensions: ['', '.js']
        },

        module: {
            loaders: [
                {
                    test: /\.js$/,
                    exclude: /(node_modules|bower_components|nform)/,
                    loader: 'babel',
                    query: {
                        plugins: ['transform-runtime'],
                        presets: ['es2015', 'stage-0']
                    }
                },
                {
                    test: /\.modernizrrc$/,
                    loader: 'modernizr'
                },
            ],
        },

        stats: {
            children: false
        },

        plugins: [
            new webpack.NoErrorsPlugin(),
            new webpack.optimize.CommonsChunkPlugin({
                name: 'common',
                minChunks: 4
            }),
        ]
    },
    {
        entry: entriesLess,

        output: {
            path: __dirname + '/www/f/min/',
            filename: '[name].build.css'
        },

        watch: true,

        watchOptions: {
            aggregateTimeout: 150
        },

        resolveLoader: {
            modulesDirectories: ['node_modules'],
            moduleTemplates: ['*-loader', '*'],
            extensions: ['', '.js']
        },

        module: {
            loaders: [
                {
                    test: /modules\/.*\.less$/,
                    loader: ExtractTextPlugin.extract('style', 'css?-url!postcss!less')
                },
            ]
        },

        postcss: function () {
            return [cssnext]
        },

        stats: {
            children: false
        },

        plugins: [
            new webpack.NoErrorsPlugin(),
            new ExtractTextPlugin('[name].build.css')
        ]
    }
];
</code></pre></div>
<p dir="auto">The problem in <a href="https://github.com/webpack/webpack/blob/master/bin/webpack.js#L269">this line</a>. In our case options is an array. So, the fastest way to fix this is to use firstOptions variable which defined above.</p>
<p dir="auto">What do you think?</p>