gatsby-1-config-extract-plugin
extract-text-webpack-plugin instance getter for Gatsby v1 plugins
Last updated 7 years ago by pieh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install gatsby-1-config-extract-plugin 
SYNC missed versions from official npm registry.

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`)
    }
  }
}

Current Tags

  • 1.0.3                                ...           latest (7 years ago)
  • 1.0.4-8                                ...           next (7 years ago)

11 Versions

  • 1.0.4-8                                ...           7 years ago
  • 1.0.4-7                                ...           7 years ago
  • 1.0.4-6                                ...           7 years ago
  • 1.0.4-5                                ...           7 years ago
  • 1.0.4-4                                ...           7 years ago
  • 1.0.4-2                                ...           7 years ago
  • 1.0.4-1                                ...           7 years ago
  • 1.0.4-0                                ...           7 years ago
  • 1.0.3                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE