From f57320e718af026b2a55e12756c608ed057bc65d Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford Date: Thu, 11 Jul 2019 16:15:01 -0700 Subject: [PATCH] Show splash screen ASAP, load render JS async --- electron-webpack.json5 | 1 + src/renderer/index.html | 19 +++++++++++++++++++ src/renderer/index.js | 4 +++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/renderer/index.html diff --git a/electron-webpack.json5 b/electron-webpack.json5 index cdc507b..29051a5 100644 --- a/electron-webpack.json5 +++ b/electron-webpack.json5 @@ -3,6 +3,7 @@ "webpackConfig": "webpack.main.additions.js" }, "renderer": { + "template": "src/renderer/index.html", "webpackConfig": "webpack.renderer.additions.js" } } diff --git a/src/renderer/index.html b/src/renderer/index.html new file mode 100644 index 0000000..65d8ed3 --- /dev/null +++ b/src/renderer/index.html @@ -0,0 +1,19 @@ + + + + + + + +

Scratch Desktop is loading...

+ + diff --git a/src/renderer/index.js b/src/renderer/index.js index 9b8fe6b..4ca0734 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -1 +1,3 @@ -import './app.jsx'; +// this is an async import so that it doesn't block the first render +// index.html contains a loading/splash screen which will display while this import loads +import('./app.jsx');