Skip to content

Commit

Permalink
chore(gatsby): Convert utils/worker/page-data to typescript (#22155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kawamataryo authored Mar 11, 2020
1 parent cb26f59 commit f71fea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/gatsby/src/utils/worker/child.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Note: this doesn't check for conflicts between module exports
import { getFilePath } from "./page-data"

module.exports = {
...require(`./page-data`),
getFilePath,
...require(`./render-html`),
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const path = require(`path`)
import path from "path"

const getFilePath = ({ publicDir }, pagePath) => {
export const getFilePath = (
{ publicDir }: { publicDir: string },
pagePath: string
): string => {
const fixedPagePath = pagePath === `/` ? `index` : pagePath
return path.join(publicDir, `page-data`, fixedPagePath, `page-data.json`)
}

module.exports = {
getFilePath,
}

0 comments on commit f71fea1

Please sign in to comment.