5 months ago

Compiling Javascript Page Scripts

Posted 5 months ago by lambooni

Most of my project uses Vue modules, that are compiled with mix/webpack and then included within the page.

I have a few areas that are still using jquery/vanialla and in these cases I generally include the page scripts within a blade template directly within @section('page-scripts').

I have come across an issue where some of the ES6 syntax is not being properly run on older browsers. The obvious fix for this is either change my code, or compile it.

My question is... if I am to compile, how is it best to include these scripts and functions that are currently only within the scope of a single page. As soon as I compile they will be included on all pages within my app.js

Please sign in or create an account to participate in this conversation.