1 | console.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 |
|
8 | var ora = require('ora');
|
9 | var spinner = ora('building for production...');
|
10 | spinner.start();
|
11 |
|
12 |
|
13 | var path = require('path');
|
14 | var dist = path.resolve(__dirname, '../') + '/dist/';
|
15 | require('shelljs/global');
|
16 | rm('-rf', dist);
|
17 | mkdir('-p', dist);
|
18 |
|
19 |
|
20 | var webpack = require('webpack');
|
21 | var webpackConfig = require('./webpack.config.js');
|
22 | webpack(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 | })
|