How can I get nextjs's json profile like webpack does?
Unanswered
Bruno Jura Hound posted this in #help-forum
Bruno Jura HoundOP
Sorry for weird title couldn't formulate it right.
Using webpack I can do the following:
Can I get the same using next? I tried
I want to get dependency graph of all my pages, like:
I know there is bundle analyzer. but I want to write a script which uses json file above and does some stuff with it
Using webpack I can do the following:
webpack --profile --json --config ./myconfig.js > graph.json
Can I get the same using next? I tried
next build --help
but profile is reserved for different purposes.I want to get dependency graph of all my pages, like:
{
["./src/pages/somepage.js"]: ["./src/components/dependency1.js", "./src/components/dependency1.js"]
...
}
I know there is bundle analyzer. but I want to write a script which uses json file above and does some stuff with it
6 Replies
@Bruno Jura Hound Sorry for weird title couldn't formulate it right.
Using webpack I can do the following:
`webpack --profile --json --config ./myconfig.js > graph.json`
Can I get the same using next? I tried `next build --help` but profile is reserved for different purposes.
I want to get dependency graph of all my pages, like:
json
{
["./src/pages/somepage.js"]: ["./src/components/dependency1.js", "./src/components/dependency1.js"]
...
}
I know there is bundle analyzer. but I want to write a script which uses json file above and does some stuff with it
maybe you can try adding webpack ProfilingPlugin in next.config
@Yi Lon Ma maybe you can try adding webpack ProfilingPlugin in next.config
Bruno Jura HoundOP
ProfilingPlugin does different job, it generates google chrome profile for debugging purposes.
What i need is a dependency tree
What i need is a dependency tree
@Yi Lon Ma https://relative-ci.com/documentation/guides/bundle-stats/nextjs-webpack-stats I found this
Bruno Jura HoundOP
it doesnt produce dependency tree either
it shows in which chunk which file went
it shows in which chunk which file went
there are plenty of tools but i want to make sure that i cannot use wepback's information before switching to different approach a getting dependency tree