-
Notifications
You must be signed in to change notification settings - Fork 61
Add sourcemaps for hal-json-vuex #972
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
Conversation
143f04e
to
00a3fe3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Macht das debuggen wahrscheinlich einfacher.
Kann ich nicht direkt beurteilen, das müssen JS Cracks machen, die das kennen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on my machine, after restarting the containers. Thanks!
I will definitely work on more helpful error messages in hal-json-vuex.
For anyone who wants to try it out, currently you can go to the profile page and press f5 to trigger a console error that happens in hal-json-vuex code. With this PR, the browser should be able to show you the original, uncompiled code of hal-json-vuex where the error happened.
|
||
config.module | ||
.rule('source-map-loader') | ||
.test(/\.(js)$/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ecamp/hal-json-vuex#9 Typescript is about to land in hal-json-vuex, so maybe add ts
to the file types? Or is that not necessary since it will be compiled to plain js anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's not necessary since, as you mentioned, we have the compiled JS in the dependencies. This is the recommended configuration for this loader: https://webpack-v3.jsx.app/loaders/source-map-loader/.
.end() | ||
.use('source-map-loader') | ||
.loader('source-map-loader') | ||
.end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't exactly understand all the lines here. Here are my assumptions:
rule
is for starting and naming a new ruletest
,use
,enforce
andinclude.add
are copied and adapted from the article you linkedend
ends the rule specification
Why is is necessary to write theuse
,loader
,end
lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't understand understand it fully either. It's just copy-pasta from different sources and it works ... I used vue inspect
to check that we get the desired webpack config, as mentioned here https://cli.vuejs.org/guide/webpack.html#chaining-advanced. You'd need to dig into the docs of https://github.com/neutrinojs/webpack-chain to understand what's going on exactly.
See last paragraph in https://www.mistergoodcat.com/post/the-joy-that-is-source-maps-with-vuejs-and-typescript