Show splash screen ASAP, load render JS async

This commit is contained in:
Christopher Willis-Ford 2019-07-11 16:15:01 -07:00
parent 414a1f0cfd
commit f57320e718
3 changed files with 23 additions and 1 deletions

View file

@ -3,6 +3,7 @@
"webpackConfig": "webpack.main.additions.js" "webpackConfig": "webpack.main.additions.js"
}, },
"renderer": { "renderer": {
"template": "src/renderer/index.html",
"webpackConfig": "webpack.renderer.additions.js" "webpackConfig": "webpack.renderer.additions.js"
} }
} }

19
src/renderer/index.html Normal file
View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.splash {
font-size: xx-large;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<div id="app"><p class="splash">Scratch Desktop is loading...</p></div>
</body>
</html>

View file

@ -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');