diff --git a/lib/config.js b/lib/config.js index dc5b5d9..fbf664f 100644 --- a/lib/config.js +++ b/lib/config.js @@ -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 diff --git a/test/app_config.js b/test/app_config.js index b108a29..598446c 100644 --- a/test/app_config.js +++ b/test/app_config.js @@ -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'])) + }) +})