How to use angular2-broccoli-prerender - 1 common examples

To help you get started, we’ve selected a few angular2-broccoli-prerender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / angular-cli / lib / broccoli / angular2-app.js View on Github external
buildTrees.push(new BroccoliFunnel(tree, {
        include: ['**/*'],
        getDestinationPath: (n) => {
          if (n.startsWith(this._sourceDir)) {
            return n.substr(this._sourceDir.length);
          }
          return n;
        }
      }));
    }

    var merged = new BroccoliMergeTrees(buildTrees, { overwrite: true });

    if (this.ngConfig.apps[0].mobile) {
      let AppShellPlugin = require('angular2-broccoli-prerender').AppShellPlugin;
      merged = new BroccoliMergeTrees([merged, new AppShellPlugin(merged, 'index.html', 'main-app-shell')], {
        overwrite: true
      });
    }

    if (loadEnvironment(this.project).production) {
      merged = this._getBundleTree(merged);
    }

    // Public folder funnel 
    var publicFolder =  new BroccoliFunnel(this._inputNode, {
      allowEmpty: true,
      srcDir: 'public',
      name: 'PublicFolderFunnel'
    });

    merged = new BroccoliMergeTrees([merged, publicFolder]);

angular2-broccoli-prerender

Prerender your Universal (isomorphic) Angular 2 app

MIT
Latest version published 8 years ago

Package Health Score

57 / 100
Full package analysis

Popular angular2-broccoli-prerender functions