I have following folder structure for NextJS project:
_posts/ components/ hooks/ config/ <--- includes config.yaml file for server pages/ public/ .env.local ...
yarn build copies all dependencies correctly except config/ folder. It includes files that are needed to run server.
Is there any way to tell nextJS compiler/bundler to copy config/ folder inside .next folder?
Things that I tried:
- Updating 'build' step in package.json with
cp -rf config/ .next/ && next build--- does not help.next buildcleans.nextfolder. Disabling the auto-clean isn't useful. - Going through documentation of
next.config.jsto see if there is a pre-build hook that can be used. --- there isn't any. - Copying
config/folder afternext build--- doesn't help asnext buildfails complaining about missingconfig/config.yamlfile.