Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions server/build/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import DynamicEntryPlugin from './plugins/dynamic-entry-plugin'
import DetachPlugin from './plugins/detach-plugin'
import getConfig from '../config'

export default async function createCompiler (dir, { dev = false } = {}) {
export default async function createCompiler (dir, { dev = false, quiet = false } = {}) {
dir = resolve(dir)

const pages = await glob('pages/**/*.js', {
Expand Down Expand Up @@ -66,9 +66,11 @@ export default async function createCompiler (dir, { dev = false } = {}) {
new DynamicEntryPlugin(),
new UnlinkFilePlugin(),
new WatchRemoveEventPlugin(),
new WatchPagesPlugin(dir),
new FriendlyErrorsWebpackPlugin()
new WatchPagesPlugin(dir)
)
if (!quiet) {
plugins.push(new FriendlyErrorsWebpackPlugin())
}
} else {
plugins.push(
new webpack.DefinePlugin({
Expand Down
5 changes: 3 additions & 2 deletions server/hot-reloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import babel, { watch } from './build/babel'
import read from './read'

export default class HotReloader {
constructor (dir) {
constructor (dir, { quiet } = {}) {
this.dir = dir
this.quiet = quiet
this.middlewares = []
this.webpackDevMiddleware = null
this.webpackHotMiddleware = null
Expand Down Expand Up @@ -38,7 +39,7 @@ export default class HotReloader {
this.watch()

const [compiler] = await Promise.all([
webpack(this.dir, { dev: true }),
webpack(this.dir, { dev: true, quiet: this.quiet }),
clean(this.dir)
])

Expand Down
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Server {
this.quiet = quiet
this.renderOpts = { dir: this.dir, dev, staticMarkup }
this.router = new Router()
this.hotReloader = dev ? new HotReloader(this.dir) : null
this.hotReloader = dev ? new HotReloader(this.dir, { quiet }) : null
this.http = null
this.config = getConfig(dir)

Expand Down