Skip to content

Commit

Permalink
fix(build): multiple pages with object config
Browse files Browse the repository at this point in the history
  • Loading branch information
nklayman committed Mar 22, 2019
1 parent 49d28f6 commit 2af978a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions __tests__/commands.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ describe('electron:build', () => {
const stringConfig = configType === 'string config'
await runCommand('electron:build', {
pages: {
index: stringConfig ? '' : { fileName: 'index.html' },
subpage: stringConfig ? '' : { fileName: 'subpage.html' }
index: stringConfig ? '' : { filename: 'index.html' },
subpage: stringConfig ? '' : { filename: 'subpage.html' }
}
})
expect(fs.writeFileSync).toBeCalledWith(
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ module.exports = (api, options) => {
// Mock data from legacy build
const pages = options.pages || { index: '' }
Object.keys(pages).forEach(page => {
if (pages[page].fileName) {
if (pages[page].filename) {
// If page is configured as an object, use the filename (without .html)
page = pages[page].fileName.replace(/\.html$/, '')
page = pages[page].filename.replace(/\.html$/, '')
}
fs.writeFileSync(
path.join(bundleOutputDir, `legacy-assets-${page}.html.json`),
Expand Down

0 comments on commit 2af978a

Please sign in to comment.