Splitting sub-projects within mix
See original GitHub issueI often need to split my app into multiple sub-projects, e.g. the frontend and the admin dashboard. I often have very different mix configurations. To solve this, I used to create two different mix-configs but then somehow need to merge the mix-manifest.json. There are approaches for that, but I would love to have that out of the box.
As a first shot this could be solved using an additional mix-method e.g. mix.subproject('frontend')
, which then would generate a mix-manifest.json like this { 'frontend': { ... } }
. If the mix manifest already exists, just the corresponding section (frontend) is updated. Possibly existing other sections should not be touched then. If no subproject is given, it may default to 'default'
.
Some other proposals for the method-name: realm
, component
, partial
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
Heh, I’ve had some ideas for this based on some of my own similar needs. I’ve slowly been working toward refactoring Mix to maybe allow for this but I’m not certain yet how some features will work or if I could possibly land the feature in a non-major release. And I know mix some plugins would definitely have to be updated to not rely on globals nearly as much (as well as Mix itself).
My idea for the api was something like this:
And for the mix CLI:
One thing to note is, right now, I think changing the mix manifest is a no-go. I’m keen on using multiple manifest files because that ensures parallel webpack builds can’t overwrite them and possibly lose changes.
However, none of this is concrete. It may happen, it may not. It’s just an idea I’ve had in the back of my head for a while that would be a nice-to-have.
I like this idea. In my case I want to have all my main code in one build with the libraries extracted out as well as another one with all my worker files and not extract the libraries. I have a dodgy setup with 2 mix files and calling mix twice with each file but it’s not the most ideal situation.