bundle.js 679 B

1234567891011121314151617181920212223242526
  1. /**
  2. * React Static Boilerplate
  3. * https://github.com/koistya/react-static-boilerplate
  4. *
  5. * Copyright © 2015-2016 Konstantin Tarkus (@koistya)
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE.txt file in the root directory of this source tree.
  9. */
  10. const webpack = require('webpack');
  11. const task = require('./task');
  12. const config = require('./webpack.config');
  13. module.exports = task('bundle', new Promise((resolve, reject) => {
  14. const bundler = webpack(config);
  15. const run = (err, stats) => {
  16. if (err) {
  17. reject(err);
  18. } else {
  19. console.log(stats.toString(config.stats));
  20. resolve();
  21. }
  22. };
  23. bundler.run(run);
  24. }));