@webjourney/vite-plugins 1.2.8 → 1.2.9-0
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/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EA0MrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAgB,uBAAuB;;;oBAKnB,MAAM,MAAM,MAAM;;;;EA0MrC;AAED,wBAAgB,sBAAsB;;;6BAKT,MAAM;EAoBlC;AAED,wBAAgB,iBAAiB;;;oBAvOb,MAAM,MAAM,MAAM;;;;;;;6BAiNT,MAAM;KA0BlC"}
|
package/dist/index.js
CHANGED
|
@@ -143,13 +143,17 @@ export function webjourneyPluginScript() {
|
|
|
143
143
|
name: 'webjourney-plugin-script',
|
|
144
144
|
enforce: 'pre',
|
|
145
145
|
transformIndexHtml(html) {
|
|
146
|
-
// Get project ID from environment
|
|
146
|
+
// Get project ID and badge visibility from environment variables
|
|
147
147
|
const projectId = process.env.WEBJOURNEY_PROJECT_ID;
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
const hideBadge = process.env.WEBJOURNEY_HIDE_BADGE === 'true';
|
|
149
|
+
// Build the meta tags
|
|
150
|
+
const projectIdTag = projectId
|
|
150
151
|
? `<meta name="webjourney-project-id" content="${projectId}">\n `
|
|
151
152
|
: '';
|
|
152
|
-
|
|
153
|
+
const hideBadgeTag = hideBadge
|
|
154
|
+
? `<meta name="webjourney-hide-badge" content="true">\n `
|
|
155
|
+
: '';
|
|
156
|
+
return html.replace('</head>', `${projectIdTag}${hideBadgeTag}<script src="${webjourneyPluginScriptHost}/plugins/plugin.iife.js"></script></head>`);
|
|
153
157
|
}
|
|
154
158
|
};
|
|
155
159
|
}
|