Skip to content

Commit

Permalink
fix(vite): html transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
skyrpex committed Feb 19, 2024
1 parent 2069f82 commit 169fd51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/vite",
"version": "0.0.2",
"version": "0.0.3",
"description": "Wing resource that allows deploying a Vite application to the cloud",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions vite/vite-plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const plugin = (options) => {
},
transformIndexHtml(html) {
return html.replace(
"<head>",
`<head>\n <script>window.${
"</head>",
` <script>window.${
options.publicEnvName
}=Object.freeze({meta:Object.freeze({env:${JSON.stringify(
}=Object.freeze({env:Object.freeze(${JSON.stringify(
options.publicEnv
)}})});</script>`
)})});</script>\n</head>`
);
},
async buildStart() {
Expand Down

0 comments on commit 169fd51

Please sign in to comment.