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

Switch to Vite HTML env variable replacement #1161

Closed
mattrunyon opened this issue Mar 20, 2023 · 0 comments · Fixed by #1304
Closed

Switch to Vite HTML env variable replacement #1161

mattrunyon opened this issue Mar 20, 2023 · 0 comments · Fixed by #1304
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mattrunyon
Copy link
Collaborator

mattrunyon commented Mar 20, 2023

When we first switched to Vite, it did not have built-in support for env variable replacement in HTML files. It now has built-in support (as of 4.2) for this as documented here

Switch the HTML variables in code-studio, embed-grid, and embed-chart to use the built-in template and remove the htmlPlugin (our previous solution) from the vite.config.ts in those packages.

We used #ENV_VARIABLE# and Vite uses %ENV_VARIABLE% now

@mattrunyon mattrunyon added enhancement New feature or request triage Issue requires triage labels Mar 20, 2023
@vbabich vbabich added this to the April 2023 milestone Mar 22, 2023
@vbabich vbabich removed the triage Issue requires triage label Mar 22, 2023
@mattrunyon mattrunyon self-assigned this Apr 24, 2023
@mattrunyon mattrunyon modified the milestones: April 2023, May 2023 May 1, 2023
mattrunyon added a commit that referenced this issue May 19, 2023
Fixes #1161 

Also fixed an embed-grid/embed-chart Vite proxy server issue in preview
mode

Tested by running `npm start` and looking at those tags in the head
which should be replaced (base, npm version, favicon). Then ran `npm run
build` and `npm run preview` and checked the tags in the built version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants