-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Re-order postBuild hook #4027
Re-order postBuild hook #4027
Conversation
Seems good. Can you add to the hook ordering tests? Something like https://github.com/ember-cli/ember-cli/blob/master/tests/unit/models/builder-test.js#L184-L189 ? |
LGTM, but +1 to tests |
447afea
to
451734b
Compare
Currently the postbuild is not very useful as it is called after everything is already in dist. The `results.directory` folder points to a directory that is going to get cleaned up soon after. This allows you to write to the final tree right before it is copied to dist.
451734b
to
1ef8617
Compare
…penner Added a new outputReady builder hook In #4027 the `postBuild` hook was re-ordered to appear before the `processBuildResult` step. This allowed you to do some work on the final tree before it was output to `dist`. This also meant there was no longer a hook which fired to do work after everything was copied to `dist`, which is something we're trying to do. This PR re-adds the old hook, fired after `processBuildResult`, but with a new name `postResult` (name was suggested in #4247). I'm open to changing the hook name if there are any better ideas. This should also resolve #4247
This patch broke my in-repo addon that I use to create a symlink in /dist after the final build is done. Is there another hook or a recommended method to accomplish this now? I changed my code to use results.directory instead (which points to the tmp dir), but this does not work, as the symlink does not get copied over, the contents of it do. I need the postBuild dist/ folder to contain an actual symlink |
There is a recent PR to add another hook for this I believe. |
For the future reader, it's |
Currently the postbuild is not very useful as it is called after everything is already in dist. The
results.directory
folder points to a directory that is going to get cleaned up soon after. This allows you to write to the final tree right before it is copied to dist.History
We need to generate some configs off of the app tree, writing that config (a json file) to the destDir of the preprocessor was not merging into the final output. Instead it caused the multiple rebuilds to occur.
Example:
We then tried just writing the config to the root of the project and then merging it in during the postBuild hook. The
results.directory
is not the destDir that ends up in the dist, thus the file was lost again./cc @dosco