Vite aggregate scripts from blade templates and push to scripts stack without duplication
Hi, I was running through the docs and didn't find anything. I have multiple blade templates (like design blocks) and each of them have some specific javascript scripts. For example, slider, accordion and etc. What solutions I am looking for is that, if there are 2 same blocks in the same page, I need only one js file to be pushed to a stack. To add blocks, I am using filament builder. So the idea is that when I am foreaching builder items, I want somehow to aggregate all js files that these blocks need and then push them to @stack('scripts') so they would appear in that page. But using @push directive, it adds duplicates to @stack if there is more than 1 same block added. Do you guys had this issue and how did you sort it out?
Please or to participate in this conversation.