Skip to content

Commit 2af978a

Browse files
committed
fix(build): multiple pages with object config
1 parent 49d28f6 commit 2af978a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

__tests__/commands.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ describe('electron:build', () => {
332332
const stringConfig = configType === 'string config'
333333
await runCommand('electron:build', {
334334
pages: {
335-
index: stringConfig ? '' : { fileName: 'index.html' },
336-
subpage: stringConfig ? '' : { fileName: 'subpage.html' }
335+
index: stringConfig ? '' : { filename: 'index.html' },
336+
subpage: stringConfig ? '' : { filename: 'subpage.html' }
337337
}
338338
})
339339
expect(fs.writeFileSync).toBeCalledWith(

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ module.exports = (api, options) => {
113113
// Mock data from legacy build
114114
const pages = options.pages || { index: '' }
115115
Object.keys(pages).forEach(page => {
116-
if (pages[page].fileName) {
116+
if (pages[page].filename) {
117117
// If page is configured as an object, use the filename (without .html)
118-
page = pages[page].fileName.replace(/\.html$/, '')
118+
page = pages[page].filename.replace(/\.html$/, '')
119119
}
120120
fs.writeFileSync(
121121
path.join(bundleOutputDir, `legacy-assets-${page}.html.json`),

0 commit comments

Comments
 (0)