2017-06-28 10:45:41 +00:00
|
|
|
require('./check-versions')()
|
|
|
|
|
|
|
|
process.env.NODE_ENV = 'development'
|
|
|
|
|
|
|
|
var rm = require('rimraf')
|
|
|
|
var path = require('path')
|
|
|
|
var chalk = require('chalk')
|
|
|
|
var webpack = require('webpack')
|
2017-06-28 18:09:32 +00:00
|
|
|
var config = require('./config')
|
2017-06-28 10:45:41 +00:00
|
|
|
var webpackConfig = require('./webpack.dev.conf')
|
2017-07-19 08:04:10 +00:00
|
|
|
var fs = require('fs')
|
|
|
|
|
2017-07-25 15:15:28 +00:00
|
|
|
if (fs.existsSync('./rice-box.go')) {
|
|
|
|
fs.unlinkSync('./rice-box.go')
|
|
|
|
}
|
|
|
|
|
2017-07-29 13:21:26 +00:00
|
|
|
if (fs.existsSync('./plugins/rice-box.go')) {
|
|
|
|
fs.unlinkSync('./plugins/rice-box.go')
|
2017-07-25 15:15:28 +00:00
|
|
|
}
|
2017-06-28 10:45:41 +00:00
|
|
|
|
2017-07-06 08:04:10 +00:00
|
|
|
rm(path.join(config.assetsRoot, config.assetsSubDirectory), err => {
|
2017-06-28 10:45:41 +00:00
|
|
|
if (err) throw err
|
|
|
|
webpack(webpackConfig, function (err, stats) {
|
|
|
|
if (err) throw err
|
|
|
|
process.stdout.write(stats.toString({
|
|
|
|
colors: true,
|
|
|
|
modules: false,
|
|
|
|
children: false,
|
|
|
|
chunks: false,
|
|
|
|
chunkModules: false
|
|
|
|
}) + '\n\n')
|
|
|
|
|
|
|
|
console.log(chalk.cyan(' Build complete.\n'))
|
|
|
|
})
|
|
|
|
})
|