1 | #! /usr/bin/env node
|
2 |
|
3 | const filesystem = require('fs-extra')
|
4 | const webpack = require('webpack')
|
5 | const webpackConfig = require('../webpack.config-prod')
|
6 | const config = require('../lib/config')
|
7 | const helpers = require('../lib/helpers')
|
8 | const server = require('../lib/server')
|
9 |
|
10 | filesystem.emptyDirSync(helpers.resolveProjectPath(config.output))
|
11 |
|
12 | webpack(webpackConfig, (error, result) => {
|
13 | if (error) throw error
|
14 |
|
15 | process.stdout.write(result.toString({
|
16 | children: false,
|
17 | chunks: false,
|
18 | chunkModules: false,
|
19 | colors: true,
|
20 | modules: false
|
21 | }))
|
22 |
|
23 | process.stdout.write('\n')
|
24 |
|
25 | server.start()
|
26 | })
|