nuxt/cli

`nuxi upgrade` should not force Nuxt into `devDependencies`

Opened this issue · 4 comments

I'm not sure if this is wanted or maybe a bug introduced in latest versions, but I noticed that when running npx nuxi upgrade --force, nuxt package is placed on devDependencies even if before the update it was in the dependencies section of package.json.

From a practical point of view it does not make a huge difference, since the final result is a website build and not a shareable node module. But I find it better in my projects to use dependencies for stuff that actually goes in the frontend of my website (nuxt, its modules, external JS libraries, and so on) and leave devDependencies for tooling and related stuff (eslint, stylelint, dev tools and everything else that will not actually end being in the site itself), and I would like this setup to be respected by the tools.

I noticed that this started to happen quite recently (not sure about the specific version tough), as I always updated Nuxt this way and I never noticed this happening until these last few days.

pi0 commented

Thanks for issue. I think we always had this issue since -D flag is hardcoded and we might need to upgrade to nypm for upgrade once it had it to smartly handle this.

Thanks to you for your swift reply! I was not exactly sure if it was a bug or a wanted feature.

Hello, Related issue: #428

This PR should fix this bug: #430

Thanks @dethdkn !!

I wish they reviewed my PR, I avoid using nuxi upgrade because it moves nuxt to devDeps. I like to organize my nuxt projects the same way @stefanobartoletti do