Next.js Discord

Discord Forum

webpack.config.js file location?

Answered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
Hi, I'm trying to find the webpack config file for Nextjs. I don't want to edit it, but just to look at what's in there and try to understand it. I was not able to find it online nor in my code, so I'm reaching out, if anyone knows where it is located?

Nextjs 13.4.19 app router

... If it's not possible in the newer versions on Nextjs, then maybe if you know a version, that I could spin up?
Answered by Chinese Chongqing Dog
My bad. You can either console.log(config) in next.config.js, or read next/dist/esm/build/webpack-config.js.
View full answer

3 Replies

Chinese Chongqing Dog
Custom Webpack config can be defined in next.config.js: https://nextjs.org/docs/app/api-reference/next-config-js/webpack
Cuban CrocodileOP
I know how to make a custom config, but I'm just trying to find and read the default nextjs webpack config
Chinese Chongqing Dog
My bad. You can either console.log(config) in next.config.js, or read next/dist/esm/build/webpack-config.js.
Answer