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.
npm install premberVerified import paths — ran on the pinned version, not inferred.
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.
Ensure your Node.js environment is version 16 or higher. Update Node.js using `nvm install 16` or similar version manager, then `nvm use 16`.
Update your Node.js environment to version 8 or higher. For versions >= 2.0.0, Node.js >= 16 is required.
Review your `config/fastboot.js` file and ensure its configuration aligns with how `ember-cli-fastboot` applies it, as Prember v2.0.0 now follows the same methodology. This may affect service worker registrations or global FastBoot configuration.
Prember now recycles the FastBoot instance after 1000 requests to mitigate potential memory leaks during very large prerendering builds. While generally an enhancement, monitor memory usage for extremely complex routes or very large numbers of prerendered URLs, as edge cases might still exist depending on app complexity.
Verify that the URLs specified in `prember.urls` are valid routes in your Ember application and are accessible via FastBoot. Ensure any dynamic data needed for those routes is available during the build process (e.g., through static mocks or data available at build time).
After building, configure your web server (e.g., Nginx, Apache, Netlify) to correctly serve the prerendered `index.html` files for the specified paths (e.g., `/about` should serve `dist/about/index.html`). The default `index.html` in `dist/` becomes `_empty.html` and a new `index.html` at the root contains the prerendered content for `/`.
Ensure `ember-cli-fastboot` is installed (`npm install --save-dev ember-cli-fastboot`) and that your Ember app builds successfully with FastBoot enabled before attempting a Prember build.
Check your `package.json` for missing `dependencies` (not `devDependencies`), especially for modules used in `app/initializers` or `app/instance-initializers`. Ensure any Node.js-specific dependencies are correctly configured for FastBoot or mocked if they are browser-only.
Upgrade your Node.js version to 16 or higher (`nvm install 16 && nvm use 16`) as `prember` v2.x.x requires Node.js >= 16.
Add an array of URLs to the `prember` configuration, e.g., `prember: { urls: ['/', '/my-page'] }`.