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
3 changes: 3 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ module.exports = class Config {
res.server.middleware.unshift(hygienist(res.server.server.baseDir))
}

// webpack must consume an array for the value in our entry object
for (let key in res.entry) { res.entry[key] = Array.prototype.concat(res.entry[key]) }

// ensure server.watchOptions.ignored is an array (browsersync accepts
// string or array), then push ['node_modules', '.git', outputDir] to make
// sure they're not watched
Expand Down
7 changes: 7 additions & 0 deletions test/app_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ test('postcss querystring options', (t) => {
t.truthy(cssLoaderConfig.loader === 'source-loader!postcss-loader?foo=bar')
})
})

test('allows typeof string for entry object\'s value', (t) => {
return compileFixture(t, 'app_config', {entry: { 'js/main': './js/index.js' }})
.then(({res}) => {
t.truthy(Array.isArray(res.stats.compilation.options.entry['js/main']))
})
})