You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m looking for a way to add global CSS that applies to all modules in dev server (@hubspot/cms-dev-server), accessible at http://hslocal.net:3000/.
The global CSS should only be applied in the development server environment and not affect the deployed HubSpot modules. Specifically, I’d like to know:
How to import a CSS file (e.g., global.css) to be applied globally across all modules during development.
Where the entry point (e.g., App.js or index.js) of the dev server can be located. I've searched for this entry point in the dev server setup but have not been able to find it, which makes it unclear where global styles can be included.
Thank you
The text was updated successfully, but these errors were encountered:
hey @jason-rosterlab. I've bumped into the exact same problem. Unsure whether this is the best approach, but ended up adding a css preprocessor to the vite.config file. This preprocessor is responsible for appending the globals file to every module's css. It's only applied in development mode.
additionalData: excludePath(...) is where the magic happens. I had to exclude the global styles path (app/styles) otherwise Vite would try to build those files as well and would cause infinite loops.
It's a bit hacky to be honest, but it has been working fine.
I’m looking for a way to add global CSS that applies to all modules in dev server (@hubspot/cms-dev-server), accessible at http://hslocal.net:3000/.
The global CSS should only be applied in the development server environment and not affect the deployed HubSpot modules. Specifically, I’d like to know:
Thank you
The text was updated successfully, but these errors were encountered: