Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionalDependencies are installed as normal dependencies #96

Open
rchl opened this issue Nov 11, 2020 · 4 comments
Open

optionalDependencies are installed as normal dependencies #96

rchl opened this issue Nov 11, 2020 · 4 comments

Comments

@rchl
Copy link

rchl commented Nov 11, 2020

This package declares prettier in optionalDependencies:

"optionalDependencies": {
"prettier": "^1.18.2"
}

I'm not sure if that was the intention, but when this @vue/component-compiler-utils is a dependency (or sub-dependency) in a given project, that optionalDependencies will be installed. And it's kinda pointless and unwanted to install prettier in my projects where I don't use it, I feel.

I know that I can use npm i --no-optional but that's a poor solution as nobody remembers to use it.

Also, I understand that it might not be desired to have prettier in peerDependencies as then it will trigger a warning when not installed.

Maybe just mention in the documentation that if you want to use prettier you have to add it manually?

@rchl
Copy link
Author

rchl commented Nov 11, 2020

Also see this excerpt from readme:

  // Whether prettify compiled render function or not (development only)
  // default: true
  prettify?: boolean

Does it mean that it's not intentional to have prettier installed when using @vue/component-compiler-utils as a dependency?

@bodograumann
Copy link

I have created a project including eslint+prettier with vue-cli and was a bit confused that after updating prettier to v2, there was still an instance of prettier v1 installed as a dependency of @vue-component-compiler-utils.
Not sure how to get rid of it. Manually removing it from package-lock.json and using npm i --no-optional installs it still.

@Levdbas
Copy link

Levdbas commented Feb 22, 2021

@sodatea could you take a look at this? It increases my node_module size by around 8mb. So given that I have around 100 projects. installed where component-compiler-utils is a dependency it is around 1 gigabyte of harddrive space that is wasted.

@MathisTLD
Copy link

this also brakes prettier-atom's behaviour
why ins't prettier removed from dependencies (or installed as dev dependency) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants