-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Make easyMDE and Trix compatible with Livewire 3 #159
Make easyMDE and Trix compatible with Livewire 3 #159
Conversation
@@ -57,6 +57,10 @@ public static function outputScripts(bool $force = false): string | |||
->sort(fn (string $script) => str($script)->contains('alpine') ? 1 : 0) | |||
->map(function (string $script) { | |||
if (str($script)->contains('alpine')) { | |||
if (config('livewire.inject_assets') && !app()->runningUnitTests()) { | |||
return; | |||
} |
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.
Heya, could you explain why you needed to add this?
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.
Because if we have Livewire installed it will inject Alpine JS automatically on every page, so there is not need to include Alpine script if inject_assets
is true.
The Dusk tests use Livewire and won't work if Alpine JS in not loaded, so I think in testing environment it's ok to have the Alpine script.
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.
Perfect, thanks @alexmanase
8ff1dcf
to
c23c7ef
Compare
Thank you! |
Fixes #80