Skip to content

Commit

Permalink
Fail hard only for .jsx?|tsx? if default export is missing (#9232)
Browse files Browse the repository at this point in the history
Makes it so that filetypes like .mdx pass through
  • Loading branch information
ChristopherBiscardi authored and KyleAMathews committed Oct 19, 2018
1 parent e39d4c2 commit 738cfc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby/src/redux/actions.js
Expand Up @@ -266,7 +266,9 @@ ${reservedFields.map(f => ` * "${f}"`).join(`\n`)}
if (
!fileContent.includes(`export default`) &&
!fileContent.includes(`module.exports`) &&
!fileContent.includes(`exports.default`)
!fileContent.includes(`exports.default`) &&
// this check only applies to js and ts, not mdx
/\.(jsx?|tsx?)/.test(path.extname(fileName))
) {
includesDefaultExport = false
}
Expand Down

0 comments on commit 738cfc1

Please sign in to comment.