So I am planning to create a website solution with NestJS based on a CMS.
The CMS will provide the page structure and nestjs will combine the components/blocks, to create the page.
The components (HTML) files, will be in a separate NPM package, so I can have a "theme" functionality and easily change a website theme by just installing another NPM package.
But I have a problem.
Some components will have accompanying .js files for different features, for example a Calendar component with its logic in a calendar.js file.
Considering I do not know the page structure at build time, I can not build a bundle with all the .js files
Would it be okay, to have the .js files minified, and concatenated during page render in nestjs? So that I provide only one .js per page request, instead of loading all .js files for each component?