I'm using multiple Bryntum products (Grid, Scheduler, Core) and the respective thin versions of the packages. I would like to support switching themes in my app so I followed the guide to allow multiple themes (https://bryntum.com/products/grid/docs/guide/Grid/integration/react/guide#selecting-from-multiple-themes). The postinstall runs correctly and themes and fonts get copied to my public directory. I've added the stylesheets but when I run my app the fonts can't be located:
This is a Next.js app (version 13.4.2) that is part of a monorepo (using nx), using webpack by default. However, I'm not sure Next is transpiling the css files that I copied to my public directory since I'm just referencing the css through a stylesheet
Seems like I need to modify the webpack config in my Next.js app to properly transpile the css file. But I'd like to use the stylesheet reference (so I can swap themes). Perhaps I need a custom build step to transpile the Bryntum css files and then place them in my public directory?
Attached a sample nx + next project that shows the error. Note: this does not do the postinstall steps, I import the core/grid css in apps/leap/app/layout.tsx
Since you're using nx Here's an approach that will work in this case.
You can copy the files to public/themes using postinstall. Copy the files to public/themes using postinstall (as you shared in the question initially).
Lastly, you have to update the font URL in the CSS files from @bryntum/core-thin/fonts/fa-solid-900.woff2 to ./fonts/fa-solid-900.woff2 everywhere.
That should fix the issue. Your project is using nx - which is causing some kind of issue with CSS files but for reference, you can check our demos to understand how it's usually done.
I've implemented the postinstall and scripted the replacement of the paths in the copied CSS files. Everything looks good and I'm able to switch between themes now.