git ssb

0+

dangerousbeans / etherstreams



Tree: 5b2e405d30a0a28a8d6b43dd4ec8b16cdba28cf8

Files: 5b2e405d30a0a28a8d6b43dd4ec8b16cdba28cf8 / build / build.js

1073 bytesRaw
1require('./check-versions')()
2
3process.env.NODE_ENV = 'production'
4
5var ora = require('ora')
6var rm = require('rimraf')
7var path = require('path')
8var chalk = require('chalk')
9var webpack = require('webpack')
10var config = require('../config')
11var webpackConfig = require('./webpack.prod.conf')
12
13var spinner = ora('building for production...')
14spinner.start()
15
16rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
17 if (err) throw err
18 webpack(webpackConfig, function (err, stats) {
19 spinner.stop()
20 if (err) throw err
21 process.stdout.write(stats.toString({
22 colors: true,
23 modules: false,
24 children: false,
25 chunks: false,
26 chunkModules: false
27 }) + '\n\n')
28
29 if (stats.hasErrors()) {
30 console.log(chalk.red(' Build failed with errors.\n'))
31 process.exit(1)
32 }
33
34 console.log(chalk.cyan(' Build complete.\n'))
35 console.log(chalk.yellow(
36 ' Tip: built files are meant to be served over an HTTP server.\n' +
37 ' Opening index.html over file:// won\'t work.\n'
38 ))
39 })
40})
41

Built with git-ssb-web