Support Forums

CSS isn't formatting correctly

Hello! My Netlify site name is https://gateway2portfolio.netlify.app/

I was able to find out why the actual site was deploying differently from Netlify than the local environment due to a bower_component file not being included in the upload… is there any way to force this to be uploaded so my portfolio site looks the way it should? The file is currently uploaded just fine in the git repository.

Hi @Gateway2Music,

Just like npm, Bower is also a package manager and it loads all assets in bower_components folder. This folder can get heavy really fast as it imports more or less the entire repos of your dependencies in your project. So if we published that folder, we’d be publishing every file of that dependency’s repo and that would be practically useless. Thus, that folder is not published.

Instead, you need to download and use only the required CSS/JS files. This would also keep the repo size small. But if you want to use Bower, you could install your dependencies during build time: Manage build dependencies | Netlify Docs. However, you’d need a JS/CSS bundler to import those assets and save it to a different folder so that it actually gets published.