Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-1-config-extract-plugin

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by7.71%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 26 Mar 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc