diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fd3b2225..ad86d296 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,7 @@ jobs: export CI=true rm -rf docs/_app yarn install + # yarn run lint version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2) yarn build git config user.name github-actions diff --git a/cypress.json b/cypress.json index 70b8e6bd..6253d1fa 100644 --- a/cypress.json +++ b/cypress.json @@ -1,7 +1,7 @@ { "projectId": "2ckppp", "$schema": "https://on.cypress.io/cypress.schema.json", - "baseUrl": "http://localhost:3000", + "baseUrl": "http://localhost:3000/mermaid-live-editor", "pluginsFile": "./cypress/plugins/index.cjs", "viewportWidth": 1440, "viewportHeight": 768, diff --git a/src/routes/edit.svelte b/src/routes/edit.svelte index 2326ff9c..17be8061 100644 --- a/src/routes/edit.svelte +++ b/src/routes/edit.svelte @@ -13,6 +13,7 @@ import type monaco from 'monaco-editor'; import type { Mermaid } from 'mermaid'; import type { EditorUpdateEvent, State, Tab } from '$lib/types'; + import { base } from '$app/paths'; const mermaid: Mermaid = (window.mermaid as unknown) as Mermaid; @@ -96,7 +97,7 @@ }; const viewDiagram = async () => { - window.open(`/view#${$base64State}`, '_blank').focus(); + window.open(`${base}/view#${$base64State}`, '_blank').focus(); }; onMount(() => { diff --git a/svelte.config.js b/svelte.config.js index b6034871..03dda5fb 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -15,11 +15,9 @@ const config = { adapter: adapter({ pages: 'docs' }), - paths: process.env['CI'] - ? { - base: '/mermaid-live-editor' - } - : {}, + paths: { + base: '/mermaid-live-editor' + }, ssr: false, // hydrate the
element in src/app.html target: '#svelte'