Prember (Pre-Render Ember)

2.1.0 · active · verified Sun Apr 19

Prember is an Ember CLI addon designed to pre-render Ember applications into static HTML files during the build process, leveraging Ember FastBoot. This transforms a dynamic Ember app into a progressive static-site, enhancing initial page load performance and SEO for specified routes. The current stable version is 2.1.0, with minor updates released periodically and significant breaking changes typically reserved for major version bumps. Key differentiators include its 100% Ember-centric development experience, data agnosticism allowing any data source, instant navigation post-hydration, and full support for modern Ember features like Embroider. It addresses the common challenge of providing fast first-contentful-paint and SEO benefits without requiring a server-side rendering (SSR) runtime in the critical path at deployment.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install `prember` and configure it in `ember-cli-build.js` to prerender a list of specified URLs during a production build.

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    // Configure prember to prerender specific URLs
    prember: {
      urls: [
        '/',          // The root path
        '/about',     // An example static page
        '/products/1',// An example dynamic path (ensure it resolves correctly)
        '/blog/latest',// Another example path
        '/contact-us' // A more descriptive path
      ]
    }
    // Other Ember CLI build options can go here
  });

  // Use `app.toTree()` to return the Broccoli tree for your app
  return app.toTree();
};

// To install the addons:
// npm install --save-dev ember-cli-fastboot prember

// To build the prerendered app:
// ember build --environment=production

view raw JSON →