css-mqpacker-webpack-plugin
Advanced tools
Comparing version 0.13.0 to 0.14.0
{ | ||
"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) |
@@ -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)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13463
325
169