I have a multi-lingual application that I use exportPathMap
but I want to transition to getStaticProps
and getStaticPaths
. My structure looks like so:
pages/[language]/[app-slug].js
However, [app-slug].js
could be any of 20 different applications with unrelated code...
After reading caveats I thought, with pre-defining the getStaticPaths
, I would be able to do:
-[language]
--[app1].js
--[app2].js
...
But it throws You cannot use different slug names for the same dynamic path ('app1' !== 'app2')
Is there any way to dynamically load the react app code based on path, or to have multiple dynamic files in one repo? (all static paths are known)
This similar answer to use query values won't work for my case, SEO and bundle size are top priorities.