Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-mqpacker-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-mqpacker-webpack-plugin - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0

10

package.json
{
"name": "css-mqpacker-webpack-plugin",
"version": "0.13.0",
"version": "0.14.0",
"description": "The Webpack plugin for pack same CSS media query rules into one using PostCSS",
"main": "src/index.js",
"types": "src/index.d.ts",
"exports": {
".": {
"default": "./src/index.js",
"types": "./src/index.d.ts"
},
"./css-mqpacker": "./css-mqpacker/index.js",
"./package.json": "./package.json"
},
"scripts": {

@@ -8,0 +16,0 @@ "hoist": "node hoist.mjs",

@@ -9,2 +9,48 @@ # css-mqpacker-webpack-plugin

**Before:**
```css
.foo {
width: 240px;
}
@media (max-width: 768px) {
.foo {
width: 576px;
}
}
.bar {
width: 160px;
}
@media (max-width: 768px) {
.bar {
width: 384px;
}
}
```
**After:**
```css
.foo {
width: 240px;
}
.bar {
width: 160px;
}
@media (max-width: 768px) {
.foo {
width: 576px;
}
.bar {
width: 384px;
}
}
```
## Install

@@ -11,0 +57,0 @@

interface Options {
/**
* Include all modules that pass test assertion
*/
test?: string | RegExp | (string | RegExp)[]
/**
* Include all modules matching any of these conditions
*/
include?: string | RegExp | (string | RegExp)[]
/**
* Exclude all modules matching any of these conditions
*/
exclude?: string | RegExp | (string | RegExp)[]
/**
* Sort media queries
*/
sort?: boolean | ((a: string, b: string) => number)
}
/**
* The Webpack plugin for pack same CSS media query rules into one using PostCSS
*/
declare class CssMqpackerPlugin {

@@ -9,0 +24,0 @@ constructor(options?: Options)

10

src/index.js

@@ -1,5 +0,5 @@

const postcss = require('postcss');
const { validate } = require('schema-utils');
const mqpacker = require('../css-mqpacker/index.js');
const schema = require('./options.json');
const postcss = require("postcss");
const { validate } = require("schema-utils");
const mqpacker = require("../css-mqpacker/index.js");
const schema = require("./options.json");

@@ -51,3 +51,3 @@ class CssMqpackerPlugin {

const scheduledTasks = Object
.keys(typeof assets === 'undefined' ? compilation.assets : assets)
.keys(typeof assets === "undefined" ? compilation.assets : assets)
.reduce((tasks, name) => {

@@ -54,0 +54,0 @@ if (matchObject(name)) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc