Skip to content

Commit

Permalink
fix: ejs support in html files (excalidraw#7822)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle authored Mar 28, 2024
1 parent 65bc500 commit 6b52356
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 19 deletions.
8 changes: 5 additions & 3 deletions excalidraw-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
</style>
<!------------------------------------------------------------------------->
<% if ("%PROD%" === "true") { %>
<% if (typeof PROD != 'undefined' && PROD == true) { %>
<script>
// Redirect Excalidraw+ users which have auto-redirect enabled.
//
Expand Down Expand Up @@ -122,7 +122,8 @@
/>

<link rel="stylesheet" href="/fonts/fonts.css" type="text/css" />
<% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%"==="true" ) { %>
<% if (typeof VITE_APP_DEV_DISABLE_LIVE_RELOAD != 'undefined' &&
VITE_APP_DEV_DISABLE_LIVE_RELOAD == true) { %>
<script>
{
const _WebSocket = window.WebSocket;
Expand Down Expand Up @@ -196,7 +197,8 @@ <h1 class="visually-hidden">Excalidraw</h1>
</header>
<div id="root"></div>
<script type="module" src="index.tsx"></script>
<% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%" !== 'true') { %>
<% if (typeof VITE_APP_DEV_DISABLE_LIVE_RELOAD != 'undefined' &&
VITE_APP_DEV_DISABLE_LIVE_RELOAD != true) { %>
<!-- 100% privacy friendly analytics -->
<script>
// need to load this script dynamically bcs. of iframe embed tracking
Expand Down
4 changes: 3 additions & 1 deletion excalidraw-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"engines": {
"node": ">=18.0.0"
},
"dependencies": {},
"dependencies": {
"vite-plugin-html": "3.2.2"
},
"prettier": "@excalidraw/prettier-config",
"scripts": {
"build-node": "node ./scripts/build-node.js",
Expand Down
4 changes: 4 additions & 0 deletions excalidraw-app/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import svgrPlugin from "vite-plugin-svgr";
import { ViteEjsPlugin } from "vite-plugin-ejs";
import { VitePWA } from "vite-plugin-pwa";
import checker from "vite-plugin-checker";
import { createHtmlPlugin } from "vite-plugin-html";

// To load .env.local variables
const envVars = loadEnv("", `../`);
Expand Down Expand Up @@ -189,6 +190,9 @@ export default defineConfig({
],
},
}),
createHtmlPlugin({
minify: true,
}),
],
publicDir: "../public",
});
Loading

0 comments on commit 6b52356

Please sign in to comment.