question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splitting sub-projects within mix

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
thecrypticacecommented, Mar 18, 2021

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:

mix.group('frontend', mix => {
  mix.js("js/frontend/app.js", "frontend/app.js");
});

mix.group('admin', mix => {
  mix.js("js/admin/app.js", "admin/app.js");
});

And for the mix CLI:

# Compile just frontend
mix --group=frontend

# Compile just admin
mix --group=admin

# Compile everything _in parallel_
mix

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.

0reactions
jeremy-smith-macocommented, Mar 24, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Splitting sub-projects within mix · Issue #2899 · laravel-mix ...
I often need to split my app into multiple sub-projects, e.g. the frontend and the admin dashboard. I often have very different mix...
Read more >
Splitting large project into sub-projects - TechNet - Microsoft
I am coming into a project with multiple interdependent workstreams; and the MPP is now running into close to 2000 line items.
Read more >
Split Complex Projects into a Separate List from quick ones?
And yes, seeing them mixed bothers me, as if I couldn´t move from one ... When I have lots of subprojects nested into...
Read more >
Reaper Subprojects
Album mastering: Once the recording and mixing is complete, you can easily import each of your song mixes as a Subproject in your...
Read more >
How to Combine Two Schedules in MS Project? 2 Easy ...
One of the biggest challenges that may occur in the splitting of a large project into a number of individual projects or subprojects,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found