Skip to content
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

Merged
merged 8 commits into from
Mar 1, 2023
Prev Previous commit
Next Next commit
fix: remove / fromm default sourcemapIgnoreList
  • Loading branch information
danielroe committed Feb 27, 2023
commit 01a5c43bc7f75889ddbc21a2562b4b56c61826b2
4 changes: 2 additions & 2 deletions docs/config/server-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default defineConfig({
## server.sourcemapIgnoreList

- **Type:** `(sourcePath: string, sourcemapPath: string) => boolean`
danielroe marked this conversation as resolved.
Show resolved Hide resolved
- **Default:** `(sourcePath) => sourcePath.includes('/node_modules/')`
- **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).
Copy link
Member

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?

Copy link
Contributor

@jecfish jecfish Mar 1, 2023

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!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jecfish, sounds great!


Expand All @@ -331,7 +331,7 @@ export default defineConfig({
server: {
// This is the default value, and will add all files with node_modules in their paths
// to the ignore list.
sourcemapIgnoreList: (sourcePath, sourcemapPath) => sourcePath.includes('/node_modules/')
sourcemapIgnoreList: (sourcePath, sourcemapPath) => sourcePath.includes('node_modules')
}
};
```
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ export function resolveServerOptions(
): ResolvedServerOptions {
const server: ResolvedServerOptions = {
preTransformRequests: true,
sourcemapIgnoreList: (sourcePath) => sourcePath.includes('/node_modules/'),
sourcemapIgnoreList: (sourcePath) => sourcePath.includes('node_modules'),
...(raw as Omit<ResolvedServerOptions, 'sourcemapIgnoreList'>),
middlewareMode: !!raw?.middlewareMode,
}
Expand Down