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
WIP: Multiple build support #3096
base: next
Are you sure you want to change the base?
Conversation
6467436
to
d895c3f
Compare
How soon we be seeing this in production builds? |
I'm not certain at the moment. I work on Mix in my spare time. There's still plenty I need to figure out here. |
I never worked on laravel mix let me know how to help you to speedup this PR I need it in one of my project. If possible can you make a TODO list and I will work with you to get this into production |
8888464
to
97f55ff
Compare
@meshakeeb heh yeah there's still quite a bit to do here. I don't have a definitive todo list but I don't expect this feature to be merged for a while. There's a lot of testing and tweaks that have to be done. It's likely this will go through a pretty heavy beta cycle as well. I don't have a definitive todo list but it is something I need to think more about and write down |
e2c83cc
to
70012f0
Compare
f9ed4b7
to
9c8cea6
Compare
70012f0
to
2ad95ad
Compare
This is a work in progress — much is still broken and all features documented or otherwise are subject to change
I'm opening this PR now to solicit feedback from any passersby about features and needed functionality.
Support for multiple builds via "Build Groups"
Build groups are separate named configurations inside a single webpack.mix.js file. A build group can define it's own assets, behavior, plugins, webpack config, etc. The builds of which are processed independently.
Defining build groups
Defining a build group requires calling
mix.group
with two arguments: a name and a callback. Providing a name allows you to tell Mix to only build a specific group (or set of groups). Build group names are case insensitive. It is an error to define the same group multiple times. You may use any name you like for a group including spaces but we recommend slug-like names separated by hyphens or underscores.The example below defines two separate builds for app1 and app2 that can be built independent of one another.
Manifest & Versioning
Manifest generation & versioning will be completely re-tooled to run entirely through webpack. This should eliminate any hash differences between generated chunks in webpack and when versioned separately by Mix. This also means that we will automatically merge the manifest across multiple builds when shared. However each build can have its own manifest by setting a different name via
mix.options
.Handling Mix Extensions / Components
This is still very much up in the air but the thought is right now that we'll instantiate an extension/component once per build group so they can keep their state local to a single group.