Gathering detailed insights and metrics for optimize-css-assets-webpack-plugin
Gathering detailed insights and metrics for optimize-css-assets-webpack-plugin
Gathering detailed insights and metrics for optimize-css-assets-webpack-plugin
Gathering detailed insights and metrics for optimize-css-assets-webpack-plugin
@types/optimize-css-assets-webpack-plugin
TypeScript definitions for optimize-css-assets-webpack-plugin
css-minimizer-webpack-plugin
CSS minimizer (minifier) plugin for Webpack
@intervolga/optimize-cssnano-plugin
WebPack 2+ plugin for CSS minification after ExtractTextPluging
css-loader
css loader module for webpack
A Webpack plugin to optimize \ minimize CSS assets.
npm install optimize-css-assets-webpack-plugin
53
Supply Chain
53
Quality
65.4
Maintenance
50
Vulnerability
95.8
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,150 Stars
64 Commits
69 Forks
13 Watching
13 Branches
14 Contributors
Updated on 08 Oct 2024
JavaScript (93.34%)
CSS (6.66%)
Cumulative downloads
Total Downloads
Last day
-6.7%
373,027
Compared to previous day
Last week
2.5%
1,990,891
Compared to previous week
Last month
15.1%
8,306,126
Compared to previous month
Last year
-34.1%
101,159,720
Compared to previous year
3
1
A Webpack plugin to optimize \ minimize CSS assets.
:warning: For webpack v5 or above please use css-minimizer-webpack-plugin instead.
It will search for CSS assets during the Webpack build and will optimize \ minimize the CSS (by default it uses cssnano but a custom CSS processor can be specified).
Since extract-text-webpack-plugin only bundles (merges) text chunks, if it's used to bundle CSS, the bundle might have duplicate entries (chunks can be duplicate free but when merged, duplicate CSS can be created).
Using npm:
1$ npm install --save-dev optimize-css-assets-webpack-plugin
:warning: For webpack v3 or below please use
optimize-css-assets-webpack-plugin@3.2.0
. Theoptimize-css-assets-webpack-plugin@4.0.0
version and above supports webpack v4.
The plugin can receive the following options (all of them are optional):
assetNameRegExp
: A regular expression that indicates the names of the assets that should be optimized \ minimized. The regular expression provided is run against the filenames of the files exported by the ExtractTextPlugin
instances in your configuration, not the filenames of your source CSS files. Defaults to /\.css$/g
cssProcessor
: The CSS processor used to optimize \ minimize the CSS, defaults to cssnano
. This should be a function that follows cssnano.process
interface (receives a CSS and options parameters and returns a Promise).cssProcessorOptions
: The options passed to the cssProcessor
, defaults to {}
cssProcessorPluginOptions
: The plugin options passed to the cssProcessor
, defaults to {}
canPrint
: A boolean indicating if the plugin can print messages to the console, defaults to true
1var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); 2module.exports = { 3 module: { 4 rules: [ 5 { 6 test: /\.css$/, 7 loader: ExtractTextPlugin.extract('style-loader', 'css-loader') 8 } 9 ] 10 }, 11 plugins: [ 12 new ExtractTextPlugin('styles.css'), 13 new OptimizeCssAssetsPlugin({ 14 assetNameRegExp: /\.optimize\.css$/g, 15 cssProcessor: require('cssnano'), 16 cssProcessorPluginOptions: { 17 preset: ['default', { discardComments: { removeAll: true } }], 18 }, 19 canPrint: true 20 }) 21 ] 22};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
35 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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