You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I strongly believe that an option to disable cache busting for hot-reload would solve a problem that many are having.
In loader.js:81 the this.sourceMap always triggers the cache busting of filenames, even when trying to generate code-coverage. Where one would want to have:
Precise filenames (without the "?[cache-key]" thing)
An actual SourceMap
So, at the end, ironically, when source-map is enabled in webpack, vue-loader informs wrong filenames to code-coverage reports. For example:
/path/to/project/src/components/MyComponent.vue?7b4a5b1a
// instead of
/path/to/project/src/components/MyComponent.vue
Today the setup to get proper code-coverage of vue components is more complicated than it should.
With an option to disable cache busting in source-map filenames, code-coverage of .vue files would be as easy as $ nyc mocha-webpack test/**/*.spec.js with a reasonable simple webpack config (even without karma).
Evidence that this is a problem
There are many people struggling with this 😢 (my team included):
This is still happening for me. the issue I have is not coverage libraries like istanbul but just editing options in developer tools. Using css in js is great but with sourcemaps on, changing anything in devtools breaks the site because all the filenames become wrong.
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
I strongly believe that an option to disable cache busting for hot-reload would solve a problem that many are having.
In
loader.js:81
thethis.sourceMap
always triggers the cache busting of filenames, even when trying to generate code-coverage. Where one would want to have:"?[cache-key]"
thing)So, at the end, ironically, when source-map is enabled in webpack,
vue-loader
informs wrong filenames to code-coverage reports. For example:Forcing people to do "workarounds" to get the real filename. For example:
https://github.com/mattlewis92/karma-coverage-istanbul-reporter/pull/3/files#diff-ff384da5c93b71dffa19fa30af8e2a2cR48
End user experience
Today the setup to get proper code-coverage of vue components is more complicated than it should.
With an option to disable cache busting in source-map filenames, code-coverage of
.vue
files would be as easy as$ nyc mocha-webpack test/**/*.spec.js
with a reasonable simple webpack config (even without karma).Evidence that this is a problem
There are many people struggling with this 😢 (my team included):
(and probably others)
What does the proposed API look like?
Because source-map
!==
cache busting for hot-reload 😅The text was updated successfully, but these errors were encountered: