Socket
Socket
Sign inDemoInstall

gatsby-1-config-extract-plugin

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gatsby-1-config-extract-plugin

extract-text-webpack-plugin instance getter for Gatsby v1 plugins


Version published
Maintainers
1
Install size
3.34 MB
Created

Readme

Source

gatsby-1-config-extract-plugin

extract-text-webpack-plugin instance getter for Gatsby v1 plugins. Allows all plugins to share the same instance. Should only be used by plugins that output styles for the main entry point and bundle (which is the vast majority of style plugins).

Install

npm install gatsby-1-config-extract-plugin --save-dev

How to use

This module exports two named functions, extractTextPlugin and extractTextFilename. Note that Gatsby's webpack config includes the extract plugin instances in the plugins array, so plugins that use this module don't need to - just use it's extract method in your loaders.

extractTextPlugin(stage)

Accepts the current stage name and returns the appropriate extract-text-webpack-plugin instance. Anywhere you would normally use new ExtractTextPlugin(), use this instead.

extractTextFilename(stage)

Accepts the current stage name and returns the name of the extracted text output file. Not required for most use cases.

// in gatsby-node.js
const { extractTextPlugin } = require(`gatsby-1-config-extract-plugin`);

exports.modifyWebpackConfig = ({ config, stage }) => {
  switch (stage) {
    case `build-css`: {
      loader: extractTextPlugin(stage).extract(`style`, `css`);
    }
  }
};

Keywords

FAQs

Last updated on 26 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc