Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. const ora = require("ora")
  2. const rm = require("rimraf")
  3. const path = require("path")
  4. const webpack = require("webpack")
  5. const config = require("./config")
  6. const webpack_config = require("./webpack_prod_config")
  7.  
  8. // start spinner
  9. const spinner = ora("building for production...")
  10. spinner.start()
  11.  
  12. // first clean the dist folder
  13. // then build a new version
  14. rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
  15. if (err) throw err
  16. webpack(webpack_config, function (err, stats) {
  17. spinner.stop()
  18. if (err) throw err
  19. process.stdout.write(stats.toString({
  20. colors: true,
  21. modules: false,
  22. children: false,
  23. chunks: false,
  24. chunkModules: false
  25. }) + "\n\n")
  26.  
  27. console.log("Build complete.\n")
  28. })
  29. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement