Closed azamat-sharapov closed 10 months ago
It seems that the Modal.vue and Confirmation.vue are not source files (not included in sourcemap), you should using 'entryFilter' not 'sourceFilter' Please check last column (URL) in your screenshot, the entry files should be started with "http://localhost:8000/assets", and the source files should be started with "../../src/" Hope it helps you.
@cenfun I put console.log inside sourceFilter and entryFilter and this is what happens:
As you can see, Modal.vue
is included in coverage report, but it shouldn't be. The problem is, I am not able to filter it out, because everything starts with http://localhost:8000/assets
in entryFilter()
. I can however filter some components in sourceFilter()
, for example packages/ui/src/Input.vue
, but for some reason, packages/ui/src/Modal.vue
is not going through sourceFilter()
. BTW, it's production build.
There is no Modal.vue
in your screenshot. Does the file Modal.vue
you mentioned is Modal.vue_vue_type_script_setup_true_lang-dbab2fea.js
?
Basically, here's the logic
First, providing all entry files which starting with 'http://localhost:8000/assets' and filtering with entryFilter
Then, tring to load sourcemaps (inline or linked) for each entry file and decoding sourcemaps for source files (filtering with sourceFilter
)
obviously, Modal.vue_vue_type_script_setup_true_lang-dbab2fea.js
is entry file, pleace check if it has map file like Modal.vue_vue_type_script_setup_true_lang-dbab2fea.js.map
, otherwise we can not get the source file Modal.vue
sorry, I can't explain it clearly, or can you provide us a demo repo so we can reproduce it locally?
There is no Modal.vue in your screenshot. Does the file Modal.vue you mentioned is Modal.vue_vue_type_script_setup_true_lang-dbab2fea.js?
Yes, because that's how it's called after compilation (Vite build). Original file in the source is Modal.vue, that's why I called it Modal.vue
otherwise we can not get the source file Modal.vue
Well, I can see that Modal.vue is not going through sourceFilter() at all, so maybe it shouldn't be included in the report at all (you can see it missing in logs)? The Modal.vue comes from completely different directory outside of src/
, but some files in src/
are importing it and it is ended up in localhost:8000/assets
for that reason.
It's is not small project, it's typescript monorepo. However, I will try to create minimal repro later. Thanks for your help so far
feel free to reopen it if any updates
Update: with build.minify = false
for Vite, this problem is solved ✅
I'm using Global Coverage Report and trying to filter out some files, which are not coming from
src/
directory.On the screenshot above, you can see that Modal.vue and Confirmation.vue are included in the report, but they shouldn't be. Their type is
js
. Although, in sourceFilter, I'm allowing only.vue
files. When I try to console.log insidesourceFilter
, I don't get Modal.vue and Confirmation.vue. Following is from config: