File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @devup-ui/vite-plugin " : patch
3+ ---
4+
5+ Fix hmr issue
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export function DevupUI({
6161 }
6262 return {
6363 name : 'devup-ui' ,
64- config : ( ) => {
64+ config ( ) {
6565 return {
6666 server : {
6767 watch : {
@@ -98,6 +98,17 @@ export function DevupUI({
9898 writeFileSync ( cssFile , css , {
9999 encoding : 'utf-8' ,
100100 } )
101+ return {
102+ code : `${ retCode }
103+ const exists = !!document.getElementById('devup-ui');
104+ const style = document.getElementById('devup-ui') || document.createElement('style');
105+ style.id = 'devup-ui';
106+ style.textContent = \`
107+ ${ css }
108+ \`;
109+ if (!exists) document.head.appendChild(style);
110+ ` ,
111+ }
101112 }
102113 return {
103114 code : retCode ,
You can’t perform that action at this time.
0 commit comments