fouc Plugin

Overview

scully-plugin-fouc is a postRenderer plugin for Scully to prevent flash of unstyled content.

Installation

To install this plugin with npm run:

$ npm install @notiz/scully-plugin-fouc --save-dev

Usage

Add the plugin to the defaultPostRenderers in your scully.config:

require("@notiz/scully-plugin-fouc");

exports.config = {
  projectRoot: "./src/app",
  defaultPostRenderers: ["fouc"],
  routes: {}
};

If you want to use the plugin for a specific route do:

require('@notiz/scully-plugin-fouc');

exports.config = {
  ...
  routes: {
    '/blog/:slug': {
      type: 'contentFolder',
      slug: {
        folder: './content/blog'
      },
      postRenderers: ['fouc']
    }
  }
  ...
};