mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:31:43 +00:00
* mv client/browser browser * Fix paths * tslint --fix * Add back .bin symlink * Relative path for symlink
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
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('dev')
|
|
|
|
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.copyPhabricator()
|
|
triggerReload()
|
|
}
|
|
)
|