Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow usage of array of configs for webpack #559

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/devServer.js
Expand Up @@ -17,6 +17,12 @@ export default function devServer(webpackConfig, serverConfig, url, cb) {

let {host, open, port, ...otherServerConfig} = serverConfig

// In case of an array of config, use the first config
// as the 'default' config for public path extraction
if (Array.isArray(webpackConfig)) {
webpackConfig = webpackConfig[0]
}

let webpackDevServerOptions = merge({
headers: {
'Access-Control-Allow-Origin': '*'
Expand Down
8 changes: 8 additions & 0 deletions src/webpackUtils.js
Expand Up @@ -82,6 +82,14 @@ function getFileDetails(stats) {
}

export function logBuildResults(stats, spinner) {
// In case of a MultiStats instance, run the function individually for each embedded stat
if (stats.stats) {
stats.stats.forEach((s) => {
logBuildResults(s)
})
return
}

if (stats.hasErrors()) {
if (spinner) {
spinner.fail()
Expand Down