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

fix(storybook): escape win32 paths #63

Merged
merged 2 commits into from
Aug 10, 2020
Merged

fix(storybook): escape win32 paths #63

merged 2 commits into from
Aug 10, 2020

Conversation

lihbr
Copy link

@lihbr lihbr commented Aug 7, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Changes

Made sure that backslashes from win32 paths (still on that mighty quest) are escaped "twice" when interpolated through Lodash templates, not familiar with Lodash's templates so I'm not sure if this is the most effective way to do that (although it's apparently the same one which is used in nuxt/utils), feel free to correct me, but it's working still ^^'

Explanation

Currently @nuxtjs/storybook does not work on platform using win32 paths (aKa Windows) because when styles array gets interpolated, win32 paths, after they got resolved (i.e. the ~/assets/css/tailwind.css coming from @nuxtjs/tailwindcss module), needs to be escaped twice.

Current output at ./.nuxt-storybook/storybook/preview.js, backslashes are not escaped

image

Server logs

image

If you need to reproduce just try to run this repository's Tailwind example on Windows 🙂

@pi0
Copy link

pi0 commented Aug 7, 2020

Thanks win friend 😬❤️

@farnabaz
Copy link
Collaborator

Thank you 👍

@farnabaz farnabaz changed the title fix: escape win32 paths fix(storybook): escape win32 paths Aug 10, 2020
@farnabaz farnabaz merged commit 55c4869 into nuxt-modules:master Aug 10, 2020
@farnabaz farnabaz mentioned this pull request Aug 11, 2020
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.

3 participants