Having a multi-step build process adds complexity and making changes more difficult. Maybe there is a better approach that will simplify tooling and improve developer experience.
Some options:
Move all the nunjucks variables into runtime
Ships more code to the client as features would be enabled/disabled during render
Makes enabling and disabling features with database changes easier
Switch to webpack
Webpack is awesome but also terrible
Can keep nunjuck and use it as a step during build
Having a multi-step build process adds complexity and making changes more difficult. Maybe there is a better approach that will simplify tooling and improve developer experience.
Some options: