Skip to content

Commit

Permalink
Fix issue with missing pages on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
szimek committed Feb 1, 2018
1 parent c10aed9 commit bdf2f3c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ exports.createPagesStatefully = async (
) => {
const { createPage, deletePage } = boundActionCreators
const program = store.getState().program
const pagesDirectory = systemPath.posix.join(program.directory, `/src/pages`)
const exts = program.extensions.map(e => `${e.slice(1)}`).join(`,`)
const pagesDirectory = systemPath.posix.join(program.directory, `/src/pages`)
const pagesGlob = `${pagesDirectory}/**/*.{${exts}}`

// Get initial list of files.
let files = await glob(`${pagesDirectory}/**/?(${exts})`)
let files = await glob(pagesGlob)
files.forEach(file => _createPage(file, pagesDirectory, createPage))

// Listen for new component pages to be added or removed.
chokidar
.watch(`${pagesDirectory}/**/*.{${exts}}`)
.watch(pagesGlob)
.on(`add`, path => {
if (!_.includes(files, path)) {
_createPage(path, pagesDirectory, createPage)
Expand Down

0 comments on commit bdf2f3c

Please sign in to comment.