Skip to content

Conversation

simfeld
Copy link
Contributor

@simfeld simfeld commented Feb 14, 2021

@simfeld simfeld force-pushed the third-party-sourcemaps branch from 143f04e to 00a3fe3 Compare February 14, 2021 17:53
Copy link
Contributor

@BacLuc BacLuc left a 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

Copy link
Member

@carlobeltrame carlobeltrame left a 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)$/)
Copy link
Member

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?

Copy link
Contributor Author

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/.

Comment on lines +40 to +43
.end()
.use('source-map-loader')
.loader('source-map-loader')
.end()
Copy link
Member

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 rule
  • test, use, enforce and include.add are copied and adapted from the article you linked
  • end ends the rule specification
    Why is is necessary to write the use, loader, end lines?

Copy link
Contributor Author

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.

@pmattmann pmattmann merged commit 3e65170 into ecamp:devel Feb 23, 2021
@simfeld simfeld deleted the third-party-sourcemaps branch February 23, 2021 22:51
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.

4 participants