import * as Webpack from 'webpack';
import { defaultWebpackConfig } from './defaultWebpackConfig';
export function watchFile(cwd, input, output, extendConfiguration, cb, error) {
    const defaultConfig = defaultWebpackConfig(cwd, input, output);
    const extendedConfiguration = Object.assign({}, extendConfiguration(defaultConfig));
    extendedConfiguration.entry = defaultConfig.entry;
    extendedConfiguration.output = defaultConfig.output;
    const compiler = Webpack(extendedConfiguration);
    compiler.watch({ aggregateTimeout: 600 }, (err, stats) => {
        if (err) {
            return error(err);
        }
        cb(stats);
    });
}
//# sourceMappingURL=watchFile.js.map