From b8d071e2236ac8ad02504fd3316e3e90c4de5e1a Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 23 Jun 2023 10:47:35 +0200 Subject: [PATCH] Added `--https` option to test Lexical in Safari in https no issue Safari doesn't allow to load non-https scripts in a https environment, so we need to load Lexical from https using a Caddy proxy. This adds the `--https` option to `yarn dev --lexical`. Might consider to somehow include a caddyfile somehow in the repo to make this work everywhere without changes. --- .github/dev.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/dev.js b/.github/dev.js index b65ce255c3..d14b75e4e2 100644 --- a/.github/dev.js +++ b/.github/dev.js @@ -134,7 +134,18 @@ if (DASH_DASH_ARGS.includes('search') || DASH_DASH_ARGS.includes('all')) { } if (DASH_DASH_ARGS.includes('lexical')) { - COMMAND_GHOST.env['editor__url'] = 'http://localhost:4173/koenig-lexical.umd.js'; + if (DASH_DASH_ARGS.includes('https')) { + // Safari needs HTTPS for it to work + // To make this work, you'll need a CADDY server running in front + // Note the port is different because of this extra layer. Use the following Caddyfile: + // https://localhost:4174 { + // reverse_proxy 127.0.0.1:4173 + // } + + COMMAND_GHOST.env['editor__url'] = 'https://localhost:4174/koenig-lexical.umd.js'; + } else { + COMMAND_GHOST.env['editor__url'] = 'http://localhost:4173/koenig-lexical.umd.js'; + } } if (DASH_DASH_ARGS.includes('comments') || DASH_DASH_ARGS.includes('all')) {