Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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
The npm package css-mqpacker-webpack-plugin receives a total of 29 weekly downloads. As such, css-mqpacker-webpack-plugin popularity was classified as not popular.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.