UNPKG

765 BJavaScriptView Raw
1console.log(
2 ' Tip:\n' +
3 ' Built files are meant to be served over an HTTP server.\n' +
4 ' Opening index.html over file:// won\'t work.\n'
5);
6
7
8var ora = require('ora');
9var spinner = ora('building for production...');
10spinner.start();
11
12
13var path = require('path');
14var dist = path.resolve(__dirname, '../') + '/dist/';
15require('shelljs/global');
16rm('-rf', dist);
17mkdir('-p', dist);
18
19
20var webpack = require('webpack');
21var webpackConfig = require('./webpack.config.js');
22webpack(webpackConfig, function (err, stats) {
23 spinner.stop();
24 if (err) throw err;
25 process.stdout.write(stats.toString({
26 colors: true,
27 modules: false,
28 children: false,
29 chunks: false,
30 chunkModules: false
31 }) + '\n');
32})