From 5130f8ae2889daf46f54536868d0211e0495b34e Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 18 Jan 2023 16:12:03 +0800 Subject: [PATCH 1/2] fix: load asciicast css async --- web_src/js/markup/asciicast.js | 5 ++++- web_src/less/markup/asciicast.less | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web_src/js/markup/asciicast.js b/web_src/js/markup/asciicast.js index d77c05b7aa5f3..902cfcb7316bc 100644 --- a/web_src/js/markup/asciicast.js +++ b/web_src/js/markup/asciicast.js @@ -2,7 +2,10 @@ export async function renderAsciinemaPlayer() { const els = document.querySelectorAll('.asciinema-player-container'); if (!els.length) return; - const player = await import(/* webpackChunkName: "asciinema-player" */'asciinema-player'); + const [player] = await Promise.all([ + import(/* webpackChunkName: "asciinema-player" */'asciinema-player'), + import(/* webpackChunkName: "asciinema-player" */'asciinema-player/dist/bundle/asciinema-player.css'), + ]); for (const el of els) { player.create(el.getAttribute('data-asciinema-player-src'), el, { diff --git a/web_src/less/markup/asciicast.less b/web_src/less/markup/asciicast.less index 468f0b4f3fabf..a52b2ae12e9dc 100644 --- a/web_src/less/markup/asciicast.less +++ b/web_src/less/markup/asciicast.less @@ -1,5 +1,3 @@ -@import "../asciinema-player/dist/bundle/asciinema-player.css"; - .asciinema-player-container { width: 100%; height: auto; From 16e124c855350ca467644a7d017262b9bcf987ac Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 18 Jan 2023 16:55:58 +0800 Subject: [PATCH 2/2] chore: retrigger CI