Can anyone figure out the solution why my Highlight JS is not working in production but it works perfectly in production?
I'm using Laravel 10, Cloudflare and Litespeed web server
This is my Highlight JS external CDN
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/github-dark.min.css"> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/highlight.min.js"></script> <script src="https://unpkg.com/highlightjs-copy/dist/highlightjs-copy.min.js"></script> <link rel="stylesheet" href="https://unpkg.com/highlightjs-copy/dist/highlightjs-copy.min.css" />
This is my script to initialize HighlightJS on post.blade.php
@push('script') <script> hljs.addPlugin(new CopyButtonPlugin()); hljs.highlightAll(); </script> @endpush
I call it on main.blade.php
@stack('script')
thanks for your help
Now fixed, guys, it was weird, in development server I don't need to use JQuery, but in production server I need to use JQuery initialization code