Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/devServer.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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