ERA-11250 Swap in new cookie manager by Osano#1526
Merged
Conversation
feat: update config in vite. ix: A osanoPlugin() Vite plugin in vite.config.js that uses transformIndexHtml to inject the Osano snippet. It checks ctx.server — when present, the dev server is running (local dev), so it skips injection. During vite build (used by all CI/CD deployments), ctx.server is undefined, so the script gets injected.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Vite build pipeline to inject the Osano cookie consent manager snippet during production builds (and avoid injecting during local dev), replacing the previous template-based injection in the legacy public/index.html.
Changes:
- Added a custom Vite
transformIndexHtmlplugin to inject the Osano script/style snippet duringvite build. - Removed the old environment-gated Osano snippet block from
public/index.html.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| vite.config.js | Adds an osanoPlugin() that injects the Osano snippet into the built index.html. |
| public/index.html | Removes the old Osano snippet that was previously injected via template logic. |
🚀 PR Environment Deployed
|
… the tags API instead of string replacement
…style hiding .osano-cm-widget should go in <head> to prevent a flash of the widget before the CSS applies
luixlive
approved these changes
Apr 6, 2026
Contributor
luixlive
left a comment
There was a problem hiding this comment.
No blockers, the code seems fine. I just added 2 small recommendations to better align with our code standards.
fix: reorder the osanoPlugin() to be at end of plugin list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: update config in vite.
ix: A osanoPlugin() Vite plugin in vite.config.js that uses transformIndexHtml to inject the Osano snippet. It checks ctx.server — when
present, the dev server is running (local dev), so it skips injection. During vite build (used by all CI/CD deployments), ctx.server is
undefined, so the script gets injected.