Skip to content

Add external custom css files to your generated html pages

Notifications You must be signed in to change notification settings

snowpact/gatsby-plugin-external-css

Repository files navigation

gatsby-plugin-external-css

Current npm package version Downloads per month on npm.

Add external custom css files to your generated html pages.

Installation

npm install gatsby-plugin-external-css

or

yarn add gatsby-plugin-external-css

Usage

This plugin lets you add a custom css file in your builded public index.html. You probably don't need this as it's for very specific usage.

In my case, I'm generating different gatsby projects based on a config, and I'm providing a custom way to give a css file out of the src folder scope.

Add the following plugin to your gatsby-config.js

Create

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-external-css',
      options: {
        source: 'full/local/path.css',
      },
    },
  ],
}

Be sure that the file exists.

The file will be copied into the final public file with a custom cache busting. The css file will be appended at the last of the meta.

About

Add external custom css files to your generated html pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published