scully-plugin-remove-unused-css
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

scully-plugin-remove-unused-css

This postRenderer plugin for Scully will remove unused CSS from the HTML of your prerendered pages.

Plugin will remove unnecessary CSS code from rendered Scully static HTMLs, which will decrease the size of your pages and drastically improve loading times.

Highly recommended to use this plugin along with CSS libraries like Angular Material.

Installation

To install this library with npm run

$ npm install scully-plugin-remove-unused-css --save-dev

or with yarn

$ yarn add scully-plugin-remove-unused-css --dev

This package depends on packages:

Both will be installed during scully-remove-unused-css installation.

Usage

Import and add the plugin to the defaultPostRenderers to execute it on all rendered pages or use the postRenderers on a route configuration to execute it for a specific route.

const { RouteTypes } = require('@scullyio/scully');
const { RemoveUnusedCSSPlugin } = require('scully-plugin-remove-unused-css');

exports.config = {
  projectRoot: './src/app',
  defaultPostRenderers: [RemoveUnusedCSSPlugin],  // for all routes
  routes: {
    '/blog/:slug': {
      type: RouteTypes.contentFolder,
      slug: {
        folder: "./blog"
      },
      postRenderers: [RemoveUnusedCSSPlugin]      // per route config
    },
  }
};

Now build your app and then just run the Scully command.

npm run build --prod
npm run scully

More information

More info on getting started with Scully can be found on their homepage.

Package Sidebar

Install

npm i scully-plugin-remove-unused-css

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

86.5 kB

Total Files

15

Last publish

Collaborators

  • galacticguys