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

Default Cache Directory Conflict Resolution #223

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

GuyGooL5
Copy link
Contributor

There is a problem starting Vite app and Storybook under storybook-builder-vite because they share the same cache directory
node_modules/.vite/ unless explicitly reassigning.
This PR retargets storybook-builder-vite's cache directory into a different one to not affect the app it's running along with.

Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

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

oooo, good point. I'm on board with this. Or, in my mind, even better would be to use node_modules/.cache/.vite-storybook, since I think .cache is a pretty common folder to keep caches in, and makes it easier to clear everything at once. But that's just an idea.

@GuyGooL5
Copy link
Contributor Author

GuyGooL5 commented Jan 31, 2022

I guess that's a better approach yet Vite itself has it's own .vite folder so I think placing the storybook cache close to it will be convenient maybe... Maybe we can even call it .vite.storybook and start a new convention 😅

Copy link
Member

@joshwooding joshwooding left a comment

Choose a reason for hiding this comment

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

LGTM

@IanVS IanVS merged commit fc6c5a6 into storybookjs:main Feb 3, 2022
@GuyGooL5 GuyGooL5 deleted the feat/default-cache-dir branch February 3, 2022 19:50
@bodograumann
Copy link
Contributor

Shouldn’t this also be changed in vite-server.ts for the serve-storybook command. For now it looks like it only affects the build-storybook mode.

@IanVS
Copy link
Member

IanVS commented Feb 4, 2022

Good catch, yes I think that would be good. Would you like to open a pr?

bodograumann added a commit to bodograumann/storybook-builder-vite that referenced this pull request Feb 4, 2022
In storybookjs#223 the vite cache directory for production build was set to a custom location, in order not to conflict with a vite application in the same project. This commit also applies that configuration for the development server.
joshwooding pushed a commit that referenced this pull request Feb 4, 2022
In #223 the vite cache directory for production build was set to a custom location, in order not to conflict with a vite application in the same project. This commit also applies that configuration for the development server.
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

Successfully merging this pull request may close these issues.

4 participants