Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
css-mqpacker-webpack-plugin
Advanced tools
The Webpack plugin for pack same CSS media query rules into one using PostCSS
The Webpack plugin for pack same CSS media query rules into one using PostCSS.
Before:
.foo {
width: 240px;
}
@media (max-width: 768px) {
.foo {
width: 576px;
}
}
.bar {
width: 160px;
}
@media (max-width: 768px) {
.bar {
width: 384px;
}
}
After:
.foo {
width: 240px;
}
.bar {
width: 160px;
}
@media (max-width: 768px) {
.foo {
width: 576px;
}
.bar {
width: 384px;
}
}
npm i css-mqpacker-webpack-plugin --save-dev
# or
yarn add css-mqpacker-webpack-plugin -D
webpack.config.js
const CssMqpackerPlugin = require('css-mqpacker-webpack-plugin');
module.exports = {
optimization: {
minimize: true,
minimizer: [
new CssMqpackerPlugin(),
],
},
};
test
Type: String|RegExp|Array<String|RegExp>
Default: /\.css(\?.*)?$/i
Test to match files against.
webpack.config.js
module.exports = {
optimization: {
minimize: true,
minimizer: [
new CssMqpackerPlugin({
test: /\.foo\.css$/i,
}),
],
},
};
include
Type: String|RegExp|Array<String|RegExp>
Default: undefined
Files to include.
webpack.config.js
module.exports = {
optimization: {
minimize: true,
minimizer: [
new CssMqpackerPlugin({
include: /\/includes/,
}),
],
},
};
exclude
Type: String|RegExp|Array<String|RegExp>
Default: undefined
Files to exclude.
webpack.config.js
module.exports = {
optimization: {
minimize: true,
minimizer: [
new CssMqpackerPlugin({
exclude: /\/excludes/,
}),
],
},
};
sort
Type: Boolean|Function
Default: false
By default, CSS MQPacker pack and order media queries as they are defined (the “first win” algorithm). If you want to sort media queries automatically, pass sort: true
.
webpack.config.js
module.exports = {
optimization: {
minimize: true,
minimizer: [
new CssMqpackerPlugin({
sort: true,
}),
],
},
};
FAQs
The Webpack plugin for pack same CSS media query rules into one using PostCSS
We found that css-mqpacker-webpack-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.