跳板机管理web端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
917 B

8 years ago
  1. // https://github.com/shelljs/shelljs
  2. require('./check-versions')()
  3. require('shelljs/global')
  4. env.NODE_ENV = 'production'
  5. var path = require('path')
  6. var config = require('../config')
  7. var ora = require('ora')
  8. var webpack = require('webpack')
  9. var webpackConfig = require('./webpack.prod.conf')
  10. console.log(
  11. ' Tip:\n' +
  12. ' Built files are meant to be served over an HTTP server.\n' +
  13. ' Opening index.html over file:// won\'t work.\n'
  14. )
  15. var spinner = ora('building for production...')
  16. spinner.start()
  17. var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
  18. rm('-rf', assetsPath)
  19. mkdir('-p', assetsPath)
  20. cp('-R', 'static/*', assetsPath)
  21. webpack(webpackConfig, function (err, stats) {
  22. spinner.stop()
  23. if (err) throw err
  24. process.stdout.write(stats.toString({
  25. colors: true,
  26. modules: false,
  27. children: false,
  28. chunks: false,
  29. chunkModules: false
  30. }) + '\n')
  31. })