
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
critical-plugin
Advanced tools
critical plugin for webpack extracts & inlines critical-path (above-the-fold) CSS from HTML
critical-plugin for webpackExtract your styles from js bundle and inlined the critical styles in your html
$ npm install critical-plugin [--save-dev]
First, instantiate the plugin with options in your webpack.config:
// webpack.config.js example
var CriticalPlugin = require('critical-plugin');
module.exports = {
// ...
plugins: [
// ... other plugins
new CritialPlugin()
]
// ...
}
You must pass a hash of configuration options to the plugin to cause the addition of attributes. List of them you can find in this link
Plese note that, do not use the following options
base,html,src,dest,css,folder, because the critical-plugin will do set them for you base on your project.
// webpack.config.js example
var CriticalPlugin = require('critical-plugin');
var criticalOptions = {
// Inline the generated critical-path CSS
// - true generates HTML
// - false generates CSS
inline: true,
// Viewport width
width: 1300,
// Viewport height
height: 900,
// Minify critical-path CSS when inlining
minify: true,
// Extract inlined styles from referenced stylesheets
extract: true,
// Complete Timeout for Operation
timeout: 30000,
// Prefix for asset directory
pathPrefix: '/MySubfolderDocrot',
// ignore CSS rules
ignore: ['font-face',/some-regexp/],
// overwrite default options
ignoreOptions: {}
};
module.exports = {
// ...
plugins: [
// ... other plugins
new CritialPlugin({ critical: criticalOptions })
]
// ...
}
Support it by giving feedback, contributing or just by 🌟 starring the project!
Follow me to be notified about new releases.
Wizardnet972 |
FAQs
critical plugin for webpack extracts & inlines critical-path (above-the-fold) CSS from HTML
We found that critical-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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.