also looking at this
fix: emit a real library build (dist/index.js + ./stx) so the package is importable
#124
6 files
+72
-13
| @@ -187,10 +187,13 @@ function buildScript(config: TrackingScriptConfig): string { | ||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | function buildConfigSection(config: TrackingScriptConfig): string { |
| 190 | // JSON.stringify the string values (matching excludePaths below) so a quote, | |
| 191 | // backslash, or newline in siteId/apiEndpoint can't break out of the literal | |
| 192 | // and corrupt the whole inline tracker. | |
| 190 | 193 | return `// Configuration |
| 191 | 194 | var CONFIG = { |
| 192 | siteId: '${config.siteId}', | |
| 193 | endpoint: '${config.apiEndpoint}/collect', | |
| 195 | siteId: ${JSON.stringify(config.siteId)}, | |
| 196 | endpoint: ${JSON.stringify(`${config.apiEndpoint}/collect`)}, | |
| 194 | 197 | honorDnt: ${config.honorDnt ?? true}, |
| 195 | 198 | sessionTimeout: ${(config.sessionTimeout ?? 30) * 60 * 1000}, |
| 196 | 199 | debug: ${config.debug ?? false}, |