Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to check if actual full file is there #275

Merged
merged 1 commit into from
May 6, 2016
Merged

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.

2 participants