Styles don't work with third party on publish, works just fine on local machine
I'm having a custom page that loads JS file and using vis-timeline third party library, custom styles works just fine on local machine but they're not applied when I publish it to the server.
6 Replies
console errors?
None
somehow, the git .ignore the public files, do u have npm on ur server? try to npm install, or if u dont have it, then npm run dev from ur local, and make sure there is no /public in .gitignore, if u're using git ofc
ah, you guide me to the right direction,
somehow when I only build npm build the styles don't get loaded, but when I npm run dev it's running properly
But, if it's on production u need to run nom run build to compile the asset
I did run it,
it's still not loading when I only build them, both in dev and in prod,
it's loading properly when I'm running dev though
found the solution,
turns out either vite or blade or laravel (not sure), doesn't allow you to combine the custom js file and the styling in one directive CMMIW,
after creating a "placeholder" which is just an empty js file, and importing that directive as a couple with the css file, it worked as intended,
here's what I did to fix it, to illustrate my phrasing better:
thanks guys π