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

append-basename-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

append-basename-webpack-plugin

Append to basename in webpack resolution

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

append-basename-webpack-plugin

Build Status

Append to basenames before resolution in webpack

style.css becomes style.dark.css

Installation

Install the package

npm install --save-dev append-basename-webpack-plugin

Add the plugin to your webpack config resolve.plugins

// webpack.config.js

const AppendBasenameWebpackPlugin = require('append-basename-webpack-plugin');

module.exports = {
  resolve: {
    plugins: [
      new AppendBasenameWebpackPlugin({
        append: '.dark'
      })
    ]
  }
}

Options

  • include - (Default: null) String or Array of patterns to include appending
  • exclude - (Default: null) String or Array of patterns to exclude appending. Takes priority over include
  • append - (Default: '') String to append to the basename of matched files
  • source - (Default 'described-relative') Source hook to tap in enhanced-resolve's resolution
  • target - (Default 'raw-file') Target hook to emit in enhanced-resolve's resolution

Why?

Push conditionals to the configuration level by overwriting imports. For example, theming with CSS modules.

FAQs

Package last updated on 15 May 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