-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Options spread to multiple gulp-assemble tasks due to shared instance #15
Comments
@nicluo thanks for pointing this out and showing a good use case. gulp-assemble is still in alpha, so we're still working on how it should interact with assemble itself. I think creating a new instance of assemble inside each task is a good idea as long as we don't want to expose any other assemble features outside of the plugin. Meaning the only way to interact with the underlying assemble instance is through an options object. Then using more advanced features would require using assemble directly instead of using gulp-assemble. Another option is exposing more methods to allow using the parent instance or a new instance. Any suggestions and feedback would be helpful. |
I agree that the instance options should be handled within the plugin. We should also work with new instances (at least currently), to support use cases such as mine. However, with grunt assemble we are able to define multiple src and destination locations within assemble config.
Gulp is more involved with the filesystem because it has the src and dest functions, which was why I took advantage by dividing into individual directories. A decision will eventually have to be made as to whether the ideal use case should be a single task for the whole site, or multiple fine-grained tasks. |
@nicluo have you considered using assemble v0.6.0 directly? I'm not sure if it will make sense for your use case, but if you're using assemble for that kind of configuration, IMHO it's probably worth a look. |
@jonschlinkert Thanks for the suggestion, I'll definitely revisit the way I configure assemble. However, at the moment I'm unable to build my site properly, or rollback to 0.1.7. I had the same issue as assemble/grunt-assemble#9 on gulp with 0.1.7. Fortunately, I have a laptop with a working version at the moment. Thought you could use a heads up while settling the transition to 0.6.0.
|
gulp-assemble 0.2.0 now requires passing in an instance of assemble so you can create new instances for each task. Check out assemble 0.6.0 docs for more information. |
I have a site which has multiple assemble tasks.
Running both tasks simultaneously creates problems on the options. In destination directories, files overlap as well (e.g. files from
assemble-main
may end up indist/admin
depending on the running order).Previously (0.1.7), I could workaround by using run-sequence, which keeps the options separated long enough for both tasks to work fine.
This does not work anymore in 0.1.8. I'm essentially trying to make the gulp task idempotent.
While exposing the instance in module.exports helps with configuring, I can't really reload the instance between tasks.
In the end, I did this as a quick fix:
1 - Is there a better way to do this that I missed?
2 - If you need more information/ minimum code to reproduce I'm more than happy to help. Thanks
The text was updated successfully, but these errors were encountered: