Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Kernel
Commits
957c5810
Commit
957c5810
authored
Oct 17, 2022
by
Romain Casati
Browse files
Kernel-loader: dynamically import CSS.
parent
817ef0b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/kernel-loader/src/main.ts
View file @
957c5810
import
{
PromiseDelegate
}
from
"
promise-delegate
"
;
import
{
KernelBase
}
from
"
@basthon/kernel-base
"
;
// css (mainly for spinner)
import
"
./style.css
"
;
declare
global
{
interface
Window
{
...
...
@@ -121,6 +119,10 @@ export class KernelLoader {
// launch kernel init
this
.
kernelAvailable
().
then
(()
=>
this
.
kernel
?.
init
());
// dynamically import css
// @ts-ignore
import
(
"
./style.css
"
);
const
layer
=
`basthon-loader-
${
fullscreen
?
"
full
"
:
"
foot
"
}
`
;
// dynamically adding the loader to the DOM
const
root
=
document
.
createElement
(
"
div
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment