cli icon indicating copy to clipboard operation
cli copied to clipboard

feat(module): Force new dependencies to be devDependencies (if it's in a specific list)

Open gxres042 opened this issue 1 year ago • 0 comments

🔗 Linked issue

#454

❓ Type of change

  • [ ] 📖 Documentation (updates to the documentation or readme)
  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] 👌 Enhancement (improving an existing functionality)
  • [x] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR makes some changes to the module add directive: it detects a specific list of npm dependencies when adding them, and if the npm dependency to be installed is in that list, it will be installed as a development dependency.

While Nuxt will extract what is needed into the final build product, dependencies like @nuxt/eslint should not be installed as “dependencies” but as “devDependencies” in the original meaning of dependencies and devDependencies. Hence the PR.

It's not a good practice to write a dead list inside the module add function, but I haven't come up with a perfect way to do it at this stage either.

gxres042 avatar Aug 25 '24 12:08 gxres042