stefano_ciotola's avatar

Best way to implement legacy chunks generated by @vitejs/plugin-legacy in app.blade.php in a Laravel 10, InertiaJS, and ReactJS app using ViteJS?

I’m currently working on a project using Laravel 10, InertiaJS, and ReactJS, with ViteJS as the bundler. I’ve added the @vitejs/plugin-legacy plugin to ensure compatibility with older browsers (iOS 9 Safari or Firefox 40, so no <script type="module"> support.

I’m looking for the best way to integrate the legacy chunks generated by this plugin into my app.blade.php file. Usually i do it with @vite("resources/js/app.jsx"), but replacing it with @vite("resources/js/app-legacy.jsx") always create a <script type="module"> tag.

Could anyone help me or tell me the best practices for implementing the legacy chunks correctly?

Thank you in advance

0 likes
1 reply
Katara78's avatar

hi wondering did you find any ways ? im facing same issue struggling for weeks

Please or to participate in this conversation.