1

I want Next.js to output built files so that local proxy can map them. How to let Next.js output dev files?

I once tried devServer.writeToDisk, but it didn't work because next.js doesn't use Webpack dev server.

// next.config.js
module.exports = {
  webpack: (config) => {
    config.devServer = { writeToDisk: true };
    return config;
  },
};
4
  • Check this out: nextjs.org/docs/advanced-features/static-html-export
    – Dominik
    Dec 24, 2020 at 4:51
  • 1
    @Dominik Thanks but I want those files to be efficiently watched and built
    – Ginpei
    Dec 24, 2020 at 5:06
  • Not sure what you mean. Next is a static site generator and you running those commands means you’re building them as artefacts. And on top of that if you like, add those files into git.
    – Dominik
    Dec 24, 2020 at 5:07
  • I meant next dev
    – Ginpei
    Dec 24, 2020 at 6:43

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.