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

Require a whitelist for "page" file types #208

Closed
KyleAMathews opened this issue Mar 23, 2016 · 2 comments · Fixed by #357 · May be fixed by tejzpr/gatsby#63
Closed

Require a whitelist for "page" file types #208

KyleAMathews opened this issue Mar 23, 2016 · 2 comments · Fixed by #357 · May be fixed by tejzpr/gatsby#63

Comments

@KyleAMathews
Copy link
Contributor

Depends on #17

@KyleAMathews
Copy link
Contributor Author

Right now if you add a file type to your pages directory which doesn't have a webpack loader, Gatsby will throw an error. Instead users should whitelist which file types are "pages" and everything else should be treated as an "asset" which is just copied over to public on build.

@KyleAMathews KyleAMathews changed the title Require a whitelist for page file types and asset file types Require a whitelist for "page" file types Mar 23, 2016
@cutemachine
Copy link

+1

KyleAMathews added a commit that referenced this issue Mar 26, 2016
app.js had three weirdly merged features.

1. It held the require.context magic function stuff from Webpack to
autoload page modules from the `pages` directory.
2. You could export a function to programatically rewrite paths.
3. You could export a function which would get run on every route change
(useful for things like tracking path changes in Google Analytics).

This PR moves the require.context to a an auto-written file. This sets
the stage for #208. To rewrite paths, now export the same function from
gatsby.config.js. And for `onRouteChange`, export this from
`gatsby-client-utils.js` which is for client-only user functions used by Gatsby core.
KyleAMathews added a commit that referenced this issue Mar 26, 2016
app.js had three weirdly merged features.

1. It held the require.context magic function stuff from Webpack to
autoload page modules from the `pages` directory.
2. You could export a function to programatically rewrite paths.
3. You could export a function which would get run on every route change
(useful for things like tracking path changes in Google Analytics).

This PR moves the require.context to a an auto-written file. This sets
the stage for #208. To rewrite paths, now export the same function from
gatsby.config.js. And for `onRouteChange`, export this from
`gatsby-client-utils.js` which is for client-only user functions used by Gatsby core.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants