Skip to content

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

Also rename path variables to filePath to avoid confusion
@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