Skip to content

Conversation

@KyleAMathews
Copy link
Contributor

No description provided.

@benstepp
Copy link
Contributor

benstepp commented May 6, 2016

Probably going to have to do this for https://github.com/gatsbyjs/gatsby/blob/master/lib/utils/static-entry.js#L5 too.

I guess webpack prefers a .js in a further down modulesDirectory than another filetype (.jsx/cjsx/*). I'll write a test this evening to cover that the user can overwrite the defaults.

@KyleAMathews
Copy link
Contributor Author

@benstepp well.... the Webpack resolver actual works correctly. The problem here is we're trying to decide if an acceptable html component exists before falling back on the default. Webpack does this automatically for us but since we're in a node environment, this is a crude way to replicate its algorithm. Make sense?

@benstepp
Copy link
Contributor

benstepp commented May 6, 2016

Ah that makes sense.

I get lost in webpack land quickly.

@KyleAMathews
Copy link
Contributor Author

Yeah, that was one of the first tricks I had to learn with Gatsby, keeping track of whether I was in Node or Webpack land as they're parallel but not quite identical lands.

@KyleAMathews
Copy link
Contributor Author

Used node-glob to check if /html.* exists. Works now. Will do new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants