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

post-build.js should be moved into gatsby-node.js #239

Closed
KyleAMathews opened this issue Apr 10, 2016 · 2 comments
Closed

post-build.js should be moved into gatsby-node.js #239

KyleAMathews opened this issue Apr 10, 2016 · 2 comments

Comments

@KyleAMathews
Copy link
Contributor

Keep things simple. All node APIs in gatsby-node and all browser APIs in gatsby-browser.

@LukeSheard
Copy link
Contributor

This seems simple enough, I'd be happy to give this a go. Would you want to keep the existing lib/utils/post-build.js or move it in to lib/isomorphic/gatsby-node.js?

@KyleAMathews
Copy link
Contributor Author

Sorry this issue wasn't super clear. Right now if you add a post-build.js file into the root of your site, Gatsby will try to require that and call its function after all building is finished. See

customPostBuild = require(`${directory}/post-build`)

So the work to be done here is to move this API to gatsby-node.js so if you want to do some work after the site is built, you'd export a function in gatsby-node.js like export.postBuild = (pages, cb) => // do some work.

Make sense?

Thanks!

benstepp added a commit to benstepp/gatsby that referenced this issue May 8, 2016
This change allows the user to provide a babelrc or a babel section in
their package.json. It also allows gatsby to be used without having to
specifiy a babelrc if the user doesn't need anything past what babel
provides as a default.

* It resolves all of the paths to become absolute such that the user can
crawl upwards as in gatsbyjs#239.

* It allows the custom usage of other babel plugins so that decorators
work as in gatsbyjs#129.
benstepp added a commit to benstepp/gatsby that referenced this issue May 8, 2016
This change allows the user to provide a babelrc or a babel section in
their package.json. It also allows gatsby to be used without having to
specifiy a babelrc if the user doesn't need anything past what babel
provides as a default.

* It resolves all of the paths to become absolute such that the user can
crawl upwards as in gatsbyjs#239.

* It allows the custom usage of other babel plugins so that decorators
work as in gatsbyjs#129.
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

No branches or pull requests

2 participants