Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
no-emit-webpack-plugin
Advanced tools
Stop an asset from being emitted by the webpack compiler.
Webpack 5
npm install --save-dev no-emit-webpack-plugin
yarn add -D no-emit-webpack-plugin
Webpack 4
npm install --save-dev no-emit-webpack-plugin@3.0.0
yarn add -D no-emit-webpack-plugin@3.0.0
:warning: By default, if you don't supply any options the bundles for all entry points will be removed.
new NoEmitPlugin(options: string | array)
string
is supplied only one asset bundle will be removed.string
that will be matched with asset bundle names, and removed.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 defined 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 Mini CSS Extract Plugin to generate the CSS asset.
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const NoEmitPlugin = require('no-emit-webpack-plugin');
module.exports = {
entry: {
style: path.resolve(__dirname, 'style.css'),
main: path.resolve(__dirname, 'main.js'),
},
module: {
rules: [{
test: /\.css/iu,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
],
}],
},
plugins: [new MiniCssExtractPlugin()],
}
MIT © Pedro Duarte
FAQs
Stop an asset from being emitted by the webpack compiler.
The npm package no-emit-webpack-plugin receives a total of 286 weekly downloads. As such, no-emit-webpack-plugin popularity was classified as not popular.
We found that no-emit-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.