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

Extend the config part in Min #2098

Merged
merged 16 commits into from
Jul 18, 2023
Merged

Extend the config part in Min #2098

merged 16 commits into from
Jul 18, 2023

Conversation

siyuniu-ms
Copy link
Contributor

and also reduce the generated min file number

@siyuniu-ms siyuniu-ms marked this pull request as ready for review July 14, 2023 23:12
@MSNev MSNev added this to the 3.0.3 milestone Jul 17, 2023
Copy link
Collaborator

@MSNev MSNev left a comment

Choose a reason for hiding this comment

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

nit: We normally put the comment above the fields for situations like this.

Approving so you can commit with or without moving the comment.

@siyuniu-ms
Copy link
Contributor Author

for reference, the generated snippet.min.js would look like:
'use strict';function e(cfg){cfg.onInit&&cfg.onInit(a)}var v,y,T,t,n,a,k=window,S=document,D=k.location,C="script",I="ingestionendpoint",w="disableExceptionTracking",E="ai.device.";"instrumentationKey"v="toLowerCase",y="crossOrigin",T="POST",t="appInsightsSDK",n=cfg.name||"appInsights",(cfg.name||k[t])&&(k[t]=n),a=k[n]||function(l){var u=!1,d=!1,g={initialize:!0,queue:[],sv:"7",version:2,config:l};function f(e,t)
...
,a.trackPageView({})):e(
{src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js",
// name: "appInsights", // Global SDK Instance name defaults to "appInsights" when not supplied
// ld: 0, // Defines the load delay (in ms) before attempting to load the sdk. -1 = block page load and add to head. (default) = 0ms load after timeout,
// useXhr: 1, // Use XHR instead of fetch to report failures (if available),
crossOrigin: "anonymous", // When supplied this will add the provided value as the cross origin attribute on the script tag
// onInit: null, // Once the application insights instance has loaded and initialized this callback function will be called with 1 argument -- the sdk instance (DO NOT ADD anything to the sdk.queue -- As they won't get called)
cfg: { // Application Insights Configuration
connectionString: "YOUR_CONNECTION_STRING"
}}
//# sourceMappingURL=snippet.min.js.map

@siyuniu-ms siyuniu-ms merged commit 6fee954 into main Jul 18, 2023
@siyuniu-ms siyuniu-ms deleted the extendConfig branch July 18, 2023 04:08
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.

2 participants