playground/src/index.tsx   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 33
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 21
mnd 2
bc 2
fnc 0
dl 0
loc 33
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
rs 10
1
import "assets/styles/styles.output.css";
2
3
if ("serviceWorker" in navigator && process.env.NODE_ENV === "production") {
4
  navigator.serviceWorker
5
    .register("./serviceWorker.js", { scope: "/modular/" })
6
    .then(
7
      function () {
8
        console.log("Service worker registration succeeded");
9
      },
10
      /*catch*/ function () {
11
        console.log("Service worker registration failed");
12
      }
13
    );
14
} else {
15
  console.log("Service workers are not supported.");
16
}
17
18
import("modular-preview").then(({ initApplication }) => {
19
  import("engine.config").then(({ default: engine }) => {
20
    initApplication({
21
      engine,
22
      onComplete: (App) => {
23
        import("react-dom").then(({ render }) => {
24
          render(App, document.getElementById("root"), () => {
25
            let Preloader = document.getElementById("preloader");
26
            if (Preloader) Preloader.style.visibility = "hidden";
27
          });
28
        });
29
      },
30
    });
31
  });
32
});
33