vue-jest icon indicating copy to clipboard operation
vue-jest copied to clipboard

Wrong `scss` resources import.

Open MaxKostenko opened this issue 6 years ago • 1 comments

If you import scss resources, All imports inside this resources will be broken. It will try to import styles base on Component file, not scss file

https://github.com/MaxKostenko/nuxt-vue-jest

MaxKostenko avatar Oct 28 '19 08:10 MaxKostenko

It seems that there are two problems with imports from scss ressources:

  • The content of files in ressources.scss is just prepended to the components scss, loosing context for relative imports (https://github.com/vuejs/vue-jest/blob/v3/lib/compilers/scss-compiler.js#L34). A solution could be to prepend @import '/absolute/path/to/file' instead.
  • The importer does not support using @import 'variables' to load @import 'variables/_index.scss which should work

While debugging we also where troubled by the silent dropping of files that could not be found (https://github.com/vuejs/vue-jest/blob/v3/lib/compilers/scss-compiler.js#L27).

JohannesLamberts avatar Aug 31 '20 16:08 JohannesLamberts