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

Don't use app.js. Move its functionality to webpack.config.js/gatsby-client-utils.js #212

Merged
merged 1 commit into from
Mar 26, 2016

Conversation

KyleAMathews
Copy link
Contributor

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.

Fixes #17

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 KyleAMathews merged commit 9643b75 into master Mar 26, 2016
@0x80 0x80 deleted the remove-app.js branch April 19, 2017 20:22
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.

1 participant