Gathering detailed insights and metrics for last-call-webpack-plugin
Gathering detailed insights and metrics for last-call-webpack-plugin
Gathering detailed insights and metrics for last-call-webpack-plugin
Gathering detailed insights and metrics for last-call-webpack-plugin
A Webpack plugin to change assets just before they are written to files.
npm install last-call-webpack-plugin
Typescript
Module System
Node Version
NPM Version
99.1
Supply Chain
99.5
Quality
75.1
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
31 Stars
22 Commits
6 Forks
4 Watchers
6 Branches
1 Contributors
Updated on Feb 14, 2023
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
last-call-webpack-plugin@3.0.0
Size
3.84 kB
NPM Version
5.6.0
Node Version
8.9.4
Published on
Mar 04, 2018
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
A Webpack plugin that allows you to transform \ modify assets just before Webpack emits them.
It allows you to transform \ modify Webpack assets just before Webpack emits them (writes them to files or memory in case you are using something like Webpack dev server).
It can be used for example to:
/* Author: John Doe */
comment on all the .js files Webpack generates.Using npm:
1$ npm install --save-dev last-call-webpack-plugin
:warning: For webpack v3 or below please use
last-call-webpack-plugin@v2.1.2
. Thelast-call-webpack-plugin@v3.0.0
version and above supports webpack v4.
The plugin can receive the following options:
function(assetName, webpackAssetObject, assets)
that returns a Promise. If the Promise returns a result this result will replace the assets content.compilation.optimize-assets
. Can be one of the following values:
compilation.optimize-chunk-assets
compilation.optimize-assets
emit
true
.Note: An environment supporting Promises or a Promise polyfill is needed for this plugin to be used.
1var cssnano = require('cssnano'); 2var LastCallWebpackPlugin = require('last-call-webpack-plugin'); 3module.exports = { 4 module: { 5 loaders: [ 6 { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") } 7 ] 8 }, 9 plugins: [ 10 new ExtractTextPlugin("styles.css"), 11 new LastCallWebpackPlugin({ 12 assetProcessors: [ 13 { 14 regExp: /\.js$/, 15 processor: (assetName, asset) => Promise.resolve('// Author: John Doe \n' + asset.source()) 16 }, { 17 regExp: /\.css$/, 18 processor: (assetName, asset) => cssnano.process(asset.source()) 19 .then(r => r.css) 20 } 21 ], 22 canPrint: true 23 }) 24 ] 25}
The processor
method is supplied an assets
object that allows asset manipulation via the setAsset(assetName, assetValue)
method. If assetValue
is null the asset will be deleted. This object can be used to generate aditional assets (like source maps) or rename the an asset (create a new asset and delete the current one).
Example:
1var cssnano = require('cssnano'); 2var LastCallWebpackPlugin = require('last-call-webpack-plugin'); 3module.exports = { 4 module: { 5 loaders: [ 6 { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") } 7 ] 8 }, 9 plugins: [ 10 new ExtractTextPlugin("styles.css"), 11 new LastCallWebpackPlugin({ 12 assetProcessors: [{ 13 regExp: /\.css$/, 14 processor: (assetName, asset, assets) => { 15 assets.setAsset(assetName + '.map', null); // Delete the <assetName>.map asset. 16 assets.setAsset(assetName + '.log', 'All OK'); // Add the <assetName>.log asset with the content 'All OK'. 17 return cssnano 18 .process(asset.source()) 19 .then(r => r.css) 20 } 21 }], 22 canPrint: true 23 }) 24 ] 25}
The assets
object also has a getAsset(assetName)
method to get the content of an asset (returns undefined in case the asset does not exist).
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More