vite-plugin-html-env
vite-plugin-html-env copied to clipboard
Plugin conflicts with vite-plugin-pwa
I'm not sure what the cause is, but I have the feeling that the html file isn't fully written yet by the time the vite-plugin-pwa starts to work on it.
Does it maybe need to await certain processes to finish?
Can you provide a code snippet?
Is the cached resource still being accessed after the vite.config.js file is modified? On my side it is fine when I use vite-plugin-pwa.
I have stopped using the plugin, but I think the cause was that the plugin didn't actually pick up <%=VITE_VAR%> properly when it wasn't inside of an existing tag and therefore the PWA plugin would trip in invalid HTML.
Something like this:
<html>
<head>
<meta content="<%=VITE_THIS_WORKS" />
<%=VITE_THIS_DOES_NOT%>
</head>
<body>
</body>
</html>
Maybe you can use version 1.2.3, I debugged this version is no problem.
<html>
<head>
<meta content="<%= VITE_THIS_WORKS %>" />
</head>
<body>
</body>
</html>