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 issue parsing relative imports in stylus files #54

Merged
merged 4 commits into from
Feb 8, 2018
Merged

Fix issue parsing relative imports in stylus files #54

merged 4 commits into from
Feb 8, 2018

Conversation

mdvorscak
Copy link
Contributor

This PR fixes #52

Relative imports are now supported in stylus
files with vue-jest
lib/process.js Outdated
if (!stylePart) return {}

let cssCode = stylePart.content
if (/^styl|stylus$/.test(stylePart.lang)) {
const vuePath = join(path, '..')
Copy link
Member

Choose a reason for hiding this comment

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

Can you use process.cwd for the path? Like in vueify—https://github.com/vuejs/vueify/blob/master/lib/compilers/stylus.js#L14

Copy link
Member

@eddyerburgh eddyerburgh 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, just one small change please

@mdvorscak
Copy link
Contributor Author

Thanks for taking a look, I also changed the directory resolution to be clearer. And as a result renamed the path variables to filePath to avoid confusion.

@eddyerburgh
Copy link
Member

Thanks 😀

@eddyerburgh eddyerburgh merged commit e047135 into vuejs:master Feb 8, 2018
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.

Error parsing stylus that contains imports
2 participants