@@ -177,14 +177,27 @@ module.exports = (api, options) => {
177
177
const normalizePageConfig = c => typeof c === 'string' ? { entry : c } : c
178
178
179
179
pages . forEach ( name => {
180
+ const pageConfig = normalizePageConfig ( multiPageConfig [ name ] )
180
181
const {
181
- title,
182
182
entry,
183
183
template = `public/${ name } .html` ,
184
184
filename = `${ name } .html` ,
185
- chunks,
186
- ...customHtmlOptions
187
- } = normalizePageConfig ( multiPageConfig [ name ] )
185
+ chunks = [ 'chunk-vendors' , 'chunk-common' , name ]
186
+ } = pageConfig
187
+
188
+ // Currently Cypress v3.1.0 comes with a very old version of Node,
189
+ // which does not support object rest syntax.
190
+ // (https://github.com/cypress-io/cypress/issues/2253)
191
+ // So here we have to extract the customHtmlOptions manually.
192
+ const customHtmlOptions = { }
193
+ for ( const key in pageConfig ) {
194
+ if (
195
+ ! [ 'entry' , 'template' , 'filename' , 'chunks' ] . includes ( key )
196
+ ) {
197
+ customHtmlOptions [ key ] = pageConfig [ key ]
198
+ }
199
+ }
200
+
188
201
// inject entry
189
202
webpackConfig . entry ( name ) . add ( api . resolve ( entry ) )
190
203
@@ -202,14 +215,13 @@ module.exports = (api, options) => {
202
215
// inject html plugin for the page
203
216
const pageHtmlOptions = Object . assign (
204
217
{ } ,
218
+ customHtmlOptions ,
205
219
htmlOptions ,
206
220
{
207
- chunks : chunks || [ 'chunk-vendors' , 'chunk-common' , name ] ,
221
+ chunks,
208
222
template : templatePath ,
209
- filename : ensureRelative ( outputDir , filename ) ,
210
- title
211
- } ,
212
- customHtmlOptions
223
+ filename : ensureRelative ( outputDir , filename )
224
+ }
213
225
)
214
226
215
227
webpackConfig
0 commit comments