123456789101112131415161718192021222324252627282930313233343536373839404142 |
- require('./check-versions')()
- process.env.NODE_ENV = 'production'
- var ora = require('ora')
- var rm = require('rimraf')
- var path = require('path')
- var chalk = require('chalk')
- var webpack = require('webpack')
- var utils = require('./utils')
- var config = require('../config')
- var webpackConfig = require('./webpack.prod.conf')
- utils.copyright()
- utils.clog('blue',`
- 项目构建中 [配置:${process.env.API_ENV}]
- `)
- var spinner = ora('请稍等...')
- spinner.start()
- rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
- if (err) throw err
- webpack(webpackConfig, function (err, stats) {
- spinner.stop()
- if (err) throw err
- process.stdout.write(stats.toString({
- colors: true,
- modules: false,
- children: false,
- chunks: false,
- chunkModules: false
- }) + '\n\n')
- utils.clog('blue','==== ♥ 构建完成 ♥ ====\n')
- // console.log(chalk.yellow(
- // ' Tip: built files are meant to be served over an HTTP server.\n' +
- // ' Opening index.html over file:// won\'t work.\n'
- // ))
- })
- })
|