including webpack config prevents `next build` but works with `next dev`
Unanswered
Northeast Congo Lion posted this in #help-forum
Northeast Congo LionOP
HI all. I have the following
calling
strangely though. when I call
next.config.ts
import type { NextConfig } from "next";
import { WebpackConfigContext } from "next/dist/server/config-shared";
export const nextConfig: NextConfig = {
output: "export",
distDir: "out",
webpack: (config, options: WebpackConfigContext) => {
console.log(options.webpack.version);
return config;
}
};
export default nextConfig;
calling
build
does not produce my export. but the webpack function is definitely invoked as I see the version output.strangely though. when I call
dev
it does produce the output.2 Replies
Himalayan
Remove the distDir.
Himalayan
Can you maybe show th error you're facing.