Browse Source

fix(webpack): set cross origin loading to anonymous (#53464)

From
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
```
anonymous
Request uses CORS headers and credentials flag is set to 'same-origin'. There is no exchange of user credentials via cookies, client-side SSL certificates or HTTP authentication, unless destination is the same origin.
```

Tldr, I was debugging this when trying to see why frames from our CDN
bundle are omitted from profiles and I think it is because they are not
treated as same-origin (we are currently not passing
crossorigin=anonymous(

From https://wicg.github.io/js-self-profiling/
```
11.2 Cross-origin execution
Cross-origin execution contexts should not be observable by the API through the realm check in the [take a sample](https://wicg.github.io/js-self-profiling/#dfn-take-a-sample) algorithm. Cross-origin iframes and other execution contexts that share an [agent](https://tc39.es/ecma262/multipage/#agent) with a profiler will therefore not have their execution observable through this API.
```
Jonas 1 year ago
parent
commit
aa47287615
1 changed files with 1 additions and 0 deletions
  1. 1 0
      webpack.config.ts

+ 1 - 0
webpack.config.ts

@@ -452,6 +452,7 @@ const appConfig: Configuration = {
     extensions: ['.jsx', '.js', '.json', '.ts', '.tsx', '.less'],
   },
   output: {
+    crossOriginLoading: 'anonymous',
     clean: true, // Clean the output directory before emit.
     path: distPath,
     publicPath: '',