-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.4] Allow multiple manifest files for mix helper #17759
Conversation
throw new Exception( | ||
"Unable to locate Mix file: {$path}. Please check your ". | ||
"Unable to locate Mix file: {$path}. Please check your " . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert all these cs changes
'webpack.mix.js output paths and try again.' | ||
); | ||
} | ||
|
||
return $shouldHotReload = file_exists(public_path('hot')) | ||
? new HtmlString("http://localhost:8080{$manifest[$path]}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert all these cs changes
$path = "/{$path}"; | ||
} | ||
|
||
if (! array_key_exists($path, $manifest)) { | ||
if ( ! array_key_exists($path, $manifest)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert all these cs changes
sorry about that |
@@ -552,38 +552,42 @@ function method_field($method) | |||
/** | |||
* Get the path to a versioned Mix file. | |||
* | |||
* @param string $path | |||
* @param string $path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes to this line, and match the cs of the next line.
? new HtmlString("http://localhost:8080{$manifest[$path]}") | ||
: new HtmlString($manifest[$path]); | ||
return file_exists(public_path($manifestDir.'/hot')) | ||
? new HtmlString("http://localhost:8080{$manifest[$path]}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the indentation changes here.
@@ -552,18 +552,22 @@ function method_field($method) | |||
/** | |||
* Get the path to a versioned Mix file. | |||
* | |||
* @param string $path | |||
* @param string $path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still a missing space after the word string in both cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be exactly 2 space characters
@SeoFood How did you ended up doing for your multiple mix files to be executed? You have one |
@brunogaspar No I have multiple This is my Directory Structure for the admin: For the frontend is use it as it is. |
Ah right, makes sense, because i was trying to use the Your way kinda makes sense as well, since you can have individual dependencies. Thanks for the fast reply 👍 |
If you have multiple laravel mix files (for backend and frontend) you can't use it with the helper.
Example mix File:
The mix-manifest.json is successfully saved in /public/admin/
Now you can add it in you blade Template with
<script src="{{ mix('js/app.js', 'admin') }}"></script>
It works with Hot Reload too and not breaking things.