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

CLI/Vue 2: install vue-loader upon init of vue 2 storybook #14018

Merged

Conversation

phated
Copy link
Contributor

@phated phated commented Feb 22, 2021

Issue: #14011

What I did

I'm not sure if we should do this or not.

Essentially, the @storybook/vue package has a peerDep on vue-loader and errors if someone doesn't install it (as was noted in the linked issue). It seems that some versions of the Vue CLI don't use webpack and don't install this dependency, so we could specify this as an extraPackages so it is always installed by sb init. Thoughts?

How to test

  • Is this testable with Jest or Chromatic screenshots? ❌
  • Does this need a new example in the kitchen sink apps? ❌
  • Does this need an update to the documentation? ❌

If your answer is yes to any of these, please make sure to include it in your PR.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks for grabbing this! 🙏

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, then again by that logic why not install all the peer deps? Where to draw the line? 🤔

  "peerDependencies": {
    "@babel/core": "*",
    "babel-loader": "^7.0.0 || ^8.0.0",
    "css-loader": "*",
    "ts-loader": "^6.2.2",
    "vue": "^2.6.8",
    "vue-loader": "^15.7.0",
    "vue-template-compiler": "^2.6.8"
  },

Copy link
Contributor

@pocka pocka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but I couldn't find

It seems that some versions of the Vue CLI don't use webpack and don't install this dependency,

the changes or issues in https://github.com/vuejs/vue-cli...

@phated
Copy link
Contributor Author

phated commented Feb 23, 2021

Hmm, then again by that logic why not install all the peer deps? Where to draw the line?

I don't have an answer for this, that's why I didn't know if we should do it. For Vue 3, I added the loader because you have to have v16 which is tagged @next on npm. It was the only extra dependency that I needed to layer onto a fresh "Vue CLI"-created project to get it to run.

@shilman shilman merged commit 5a913e4 into storybookjs:next Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants