-
Notifications
You must be signed in to change notification settings - Fork 133
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 remove files from dist, unable to update context.distFiles
#457
Comments
Can this logic be implemented by tapping into ember-cli's build-hooks directly instead? Manipulating the build in another plugin seems like a suboptimal solution to me as the actual build is configured in Was that impossible in your particular use-case (removing instead of adding of course)? |
Not with StaticBoot, unfortunately. StaticBoot produces a separate static build in a subfolder. The subfolder is configurable, but it can't be set to dist root. Also, the ability to modify arrays on context is a general feature not limited to this use case or this deploy step. |
We knew that this was a potentially limiting aspect of our approach to the Currently, the ember-cli-deploy "way" to think about this is not to think about removing files from |
With the proposed feature, I can simply create a deploy addon that removes files from the dist. This will work for any consuming addon. With configure the plugin that is consuming
Repeat for every consuming addon. After having this done for a few addons, one would naturally consider extracting the filtering feature into a reusable addon — and we're back to where we started. I want to emphasize again that the feature is not limited to removing files from dist. It is useful for any other potential use case where any array on |
Let me tell you about one use case.
The most natural use case is deploying the website to GitHub Pages. It even substitutes for lack of URL rewriting! There are three
Thus, this issue prevents You can't realistically expect every addon to account for this use case, and the fact that "you knew" only makes it worse. Modifying I've filed a PR that allows that: #459. Here's my website deployed using it: http://lolma.us (try it with and without JS). |
@lolmaus What are the three |
@lukemelia Thank you for considering my request! 🙇 Here are the addons that I meant: |
Current logic always appends to arrays in the context, making it impossible to remove entries from
context.distFiles
:ember-cli-deploy/lib/models/pipeline.js
Lines 178 to 180 in ba13031
I've managed to monkey patch it like this and it worked:
https://github.com/lolmaus/lolma.us/blob/b7c1163dccab5d21c4bc4245b0483da5f698fa4a/lib/ember-cli-deploy-manipulate/index.js#L13-L20
I can try adding a test case and filing a pull request. Need confirmation, recommendations welcome.
The text was updated successfully, but these errors were encountered: