usetraceforge 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webpack-loader.js +4 -1
- package/package.json +1 -1
package/dist/webpack-loader.js
CHANGED
|
@@ -22,7 +22,10 @@ export default function traceForgeLoader(source) {
|
|
|
22
22
|
});
|
|
23
23
|
// If we found any API route exports, wrap them!
|
|
24
24
|
if (exportedMethods.length > 0) {
|
|
25
|
-
modifiedSource = `import { withTraceForge } from "usetraceforge/next";\n` +
|
|
25
|
+
modifiedSource = `import { withTraceForge } from "usetraceforge/next";\n` +
|
|
26
|
+
`import TraceForge from "usetraceforge";\n` +
|
|
27
|
+
`TraceForge.init({ apiKey: process.env.NEXT_PUBLIC_TRACEFORGE_API_KEY, endpoint: process.env.NEXT_PUBLIC_TRACEFORGE_INGEST_URL });\n` +
|
|
28
|
+
modifiedSource;
|
|
26
29
|
exportedMethods.forEach(method => {
|
|
27
30
|
modifiedSource += `\nexport const ${method} = withTraceForge(_tf_${method});`;
|
|
28
31
|
});
|