Skip to content

Commit

Permalink
fix ejs condition
Browse files Browse the repository at this point in the history
  • Loading branch information
medyo committed Jul 22, 2023
1 parent a6ac8ba commit 078aa42
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<link rel="preconnect" href="https://hackertab.dev" />
<script src="/startup.js"></script>

<% if (env.VITE_BUILD_TARGET === 'web') { %>
<% if (isWebBuild) { %>
<title>Hackertab</title>
<link rel="manifest" href="%PUBLIC_URL%/web_manifest.json" />
<link rel="manifest" href="/web_manifest.json" />
<% } else { %>
<title>New Tab</title>
<% } %>
<%}%>
</head>
<body class="preload">
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"styled-components": "2",
"timeago.js": "^4.0.2",
"type-fest": "^1.2.0",
"vite-plugin-ejs": "^1.6.4",
"web-vitals": "^0.2.4",
"zustand": "^4.3.3",
"vite-plugin-ejs": "^1.6.4"
"zustand": "^4.3.3"
},
"proxy": "https://api.hackertab.dev/",
"scripts": {
Expand Down
11 changes: 7 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ export default defineConfig(({ mode }) => {

return {
plugins: [
ViteEjsPlugin((viteConfig) => ({
env: viteConfig.env,
})),
,
ViteEjsPlugin((viteConfig) => {
console.log(viteConfig.env)
return {
env: viteConfig.env,
isWebBuild: viteConfig.env.VITE_BUILD_TARGET === 'web',
}
}),
react(),
viteTsconfigPaths(),
svgrPlugin(),
Expand Down

0 comments on commit 078aa42

Please sign in to comment.