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

no-emit-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-emit-webpack-plugin

Stop an asset from being emitted by the webpack compiler.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

No Emit WebPack Plugin

Stop an asset from being emitted by the webpack compiler.

Install

npm install --save-dev no-emit-webpack-plugin

Usage

This plugin is most useful when you are bundling assets that start from file types other than JavaScript, like styles for instance. With it you can remove the resulting file difined in the output option of your webpack.config.js.

Below is an example on how to remove the style.js file from the emitted assets. We'll use the Extract Text Plugin to generate the CSS asset.

const ExtractTextPlugin = require("extract-text-webpack-plugin");
const NoEmitPlugin = require("no-emit-webpack-plugin");

module.exports = {
  entry: "./src/style.scss",
  output: {
    filename: "[name].js",
    path: path.resolve(__dirname, "./")
  },
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: ExtractTextPlugin.extract({
          fallback: "style-loader",
          use: "css-loader"
        })
      }
    ]
  },
  plugins: [
    new ExtractTextPlugin("styles.css"),
    new NoEmitPlugin()
  ]
}

Options

:warning: By default, if you don't supply any options the bundles for all entrypoints will be removed.

new NoEmitPlugin(options: string | array)
  • If a string is supplied only one asset bundle will be removed.
  • The array must be composed of elements with type string that will be matched with asset bundle names, and removed.

Keywords

FAQs

Package last updated on 16 Apr 2019

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