-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
feat: add sourcemapIgnoreList
configuration option
#12174
Conversation
I updated #12079 to use this choke-point as well, which seems to catch all the cases now (still puzzling to me why sometimes |
Co-authored-by: patak <matias.capeletto@gmail.com>
Labeled as P3 so we get to it in the next team meeting (in 10 days) before releasing 4.2. We may get to it async sooner though. |
Does Nuxt need to pass to |
Yes, we also likely want to exclude generated virtual files. |
Does virtual files in Nuxt use the |
What is this convention? Have never heard of it, but this sounds very relevant to DevTools. Do you have links / docs? |
They are usually conventions in Rollup and Vite: https://rollupjs.org/plugin-development/#conventions and https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention, where in the
|
Thanks for the pointers. That explains the |
We also have other files in
In any case, it seems like a good default. But one implementation question: IIRC, it's possible to specify more than one output in rollup; do you know if that is supported by vite (or in use by other frameworks)? |
If we would like to share a single option for build and the dev server, I think we should have it be a shared option (on the root of the config object, but then we have to read both the shared one and the rollup one). It makes sense to me to have a separate option for the server and build, it could be more flexible and these options are going to be used normally by frameworks more than final users. |
Hmm yeah looks like you can specify multiple outputs, I guess we could go with a new option then. We do sometimes refer to |
We discussed with Evan about this PR today, we can move forward after applying the |
- **Type:** `false | (sourcePath: string, sourcemapPath: string) => boolean` | ||
- **Default:** `(sourcePath) => sourcePath.includes('node_modules')` | ||
|
||
Whether or not to ignore source files in the server sourcemap, used to populate the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension). |
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.
@bmeurer not blocking for the PR, but it would be nice to be able to link to a more focused blog post about x_google_ignoreList
. If your team ends up having a better resource in the future, would you do a PR to rewire these references?
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.
+1 to this, I will draft something up and send another PR to update it. Thanks for calling that out!
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.
Thanks @jecfish, sounds great!
sourcemapIgnoreList
configuration optionsourcemapIgnoreList
configuration option
Thanks folks! Now we'll also need to update |
Description
This PR adds support for adding hints to ignore library sources in the sourcemaps served up by the dev server. (Rollup support for sourcemaps in build was added in rollup/rollup#4848 and is configurable through
build.rollupOptions.output.sourcemapIgnoreList
- see nuxt implementation.)It's largely a copy of @bmeurer's code from that PR to Vite.
In addition, it defaults to ignoring sources that are within
node_modules
, though this can of course be overridden by users/frameworks using vite.I've marked as a draft so we can discuss further the API of the function and what else we might like to do in this particular function -
in particular, it might be an opportunity to elevate the changes in #12079 to this point, applying them either here (or just after this function is called).Note: this PR came out of a conversation with @bmeurer so would appreciate a
Co-authored-by
crediting him (or he may wish to open a new PR with a slightly different take on this one).What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).