@@ -28,11 +28,11 @@
Loading
28 28
                {(props: any) => {
29 29
                  const pageComponent = async
30 30
                    ? loadable<any>(() =>
31 -
                        (pageComponents[i] as Promise<{ default: React.ComponentType }>).then(({ default: c }) =>
31 +
                        (pageComponents[i]() as Promise<{ default: React.ComponentType }>).then(({ default: c }) =>
32 32
                          createPageConfig(c, page.route)
33 33
                        )
34 34
                      )
35 -
                    : createPageConfig(pageComponents[i] as React.ComponentType, page.route);
35 +
                    : createPageConfig(pageComponents[i]() as React.ComponentType, page.route);
36 36
                  return React.createElement(pageComponent, {
37 37
                    ...props,
38 38
                    pageConfig: {

@@ -27,7 +27,15 @@
Loading
27 27
        )},
28 28
        pageComponents: [
29 29
          ${Array.from(this.builder.entryCollection.entries.values())
30 -
            .map(entry => `import(/* webpackChunkName: "${entry.name}" */'${entry.filename}')`)
30 +
            .map(
31 +
              entry => `function() {
32 +
  return import(
33 +
    /* webpackPrefetch: true */
34 +
    /* webpackChunkName: "${entry.name}" */
35 +
    '${entry.filename}'
36 +
  )
37 +
}`
38 +
            )
31 39
            .join(',')}
32 40
        ],
33 41
        plugins: [

@@ -1,4 +1,5 @@
Loading
1 1
import * as path from 'path';
2 +
import * as fs from 'fs';
2 3
import * as webpack from 'webpack';
3 4
import Config from 'webpack-chain';
4 5
import HtmlWebpackPlugin from 'html-webpack-plugin';
@@ -20,7 +21,9 @@
Loading
20 21
      {
21 22
        filename: entry.name + '.html',
22 23
        chunks: [entry.name],
23 -
        template: path.resolve(__dirname, '../../../template/index.html.ejs'),
24 +
        template: fs.existsSync(path.join(builder.projectPath.publicDir(), '/index.html'))
25 +
          ? path.join(builder.projectPath.publicDir(), '/index.html')
26 +
          : path.resolve(__dirname, '../../../template/index.html.ejs'),
24 27
        env: process.env.NODE_ENV,
25 28
      },
26 29
    ]);

@@ -1,4 +1,5 @@
Loading
1 1
import * as path from 'path';
2 +
import * as fs from 'fs';
2 3
import * as webpack from 'webpack';
3 4
import Config from 'webpack-chain';
4 5
import HtmlWebpackPlugin from 'html-webpack-plugin';
@@ -32,7 +33,9 @@
Loading
32 33
33 34
  config.plugin('html-webpack-plugin').use(HtmlWebpackPlugin, [
34 35
    {
35 -
      template: path.resolve(__dirname, '../../../template/index.html.ejs'),
36 +
      template: fs.existsSync(path.join(builder.projectPath.publicDir(), '/index.html'))
37 +
        ? path.join(builder.projectPath.publicDir(), '/index.html')
38 +
        : path.resolve(__dirname, '../../../template/index.html.ejs'),
36 39
      env: process.env.NODE_ENV,
37 40
    },
38 41
  ]);
Files Coverage
packages 90.84%
Project Totals (363 files) 90.84%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading