Skip to content

Commit

Permalink
update(console): replace inject html (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
waynelwz authored Jul 26, 2023
1 parent 468aaa7 commit a43c439
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion console/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta http-equiv="Cache-Control" content="public" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Homepage | Starwhale MLOps service" />
%__INJECT__%
<!--__INJECT__-->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
12 changes: 6 additions & 6 deletions console/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const htmlPlugin = (mode) => {
return {
name: 'html-transform',
transformIndexHtml(html) {
if (mode === 'extend')
return html.replace(
/%__INJECT__%/,
`<script>
return html.replace(
/<!--__INJECT__-->/,
mode === 'extend'
? `<script>
var _hmt = _hmt || []
;(function () {
var hm = document.createElement('script')
Expand All @@ -71,8 +71,8 @@ const htmlPlugin = (mode) => {
s.parentNode.insertBefore(hm, s)
})()
</script>`
)
return html
: ''
)
},
}
}
Expand Down

0 comments on commit a43c439

Please sign in to comment.