forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.ts
More file actions
41 lines (31 loc) · 1.04 KB
/
dev.ts
File metadata and controls
41 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { noop } from 'lodash'
import signale from 'signale'
import webpack from 'webpack'
import config from '../config/webpack/dev.config'
import * as autoReloading from './auto-reloading'
import * as tasks from './tasks'
signale.config({ displayTimestamp: true })
const triggerReload = process.env.AUTO_RELOAD === 'false' ? noop : autoReloading.initializeServer()
const buildChrome = tasks.buildChrome('dev')
const buildFirefox = tasks.buildFirefox('dev')
tasks.copyAssets()
const compiler = webpack(config)
signale.info('Running webpack')
compiler.hooks.watchRun.tap('Notify', () => signale.await('Compiling...'))
compiler.watch(
{
aggregateTimeout: 300,
},
(err, stats) => {
signale.complete(stats.toString(tasks.WEBPACK_STATS_OPTIONS))
if (err || stats.hasErrors()) {
signale.error('Webpack compilation error')
return
}
signale.success('Webpack compilation done')
buildChrome()
buildFirefox()
tasks.copyIntegrationAssets()
triggerReload()
}
)