Skip to content

fix: external css files src resolution #286

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

Merged

Conversation

FRSgit
Copy link

@FRSgit FRSgit commented Sep 24, 2020

Follow up of #158 PR - external css files might use paths which need moduleNameMapper resolution.

In case of the app I'm working on, we use external SCSS in a following way:

<style lang="scss" src="@/assets/stylesheets/_bootstrap.module.scss" module="$styleBootstrap" />

vue-jest have failed in this case, because it always tried to load style.src as a relative path.
Now, the moduleNameMapper is used to resolve correct, absolute path before anything else happens.

Change have been tested - I think this one, simple test is enough to cover it, what do you think?

@lmiller1990
Copy link
Member

Simple enough, seems low risk. thanks!

@lmiller1990 lmiller1990 merged commit d92f21f into vuejs:master Sep 28, 2020
@FRSgit FRSgit deleted the fix-external-css-files-src-resolution branch September 29, 2020 00:18
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.

2 participants