cssnano-preset-lite 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "cssnano-preset-lite",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "main": "src/index.js",
5
+ "types": "types/index.d.ts",
5
6
  "description": "Safe and minimum transformation",
6
7
  "files": [
7
8
  "LICENSE-MIT",
8
- "src"
9
+ "src",
10
+ "types"
9
11
  ],
10
12
  "license": "MIT",
11
13
  "dependencies": {
12
- "cssnano-utils": "^3.0.2",
13
- "postcss-discard-comments": "^5.0.3",
14
- "postcss-discard-empty": "^5.0.3",
15
- "postcss-normalize-whitespace": "^5.0.4"
14
+ "cssnano-utils": "^3.1.0",
15
+ "postcss-discard-comments": "^5.1.0",
16
+ "postcss-discard-empty": "^5.1.0",
17
+ "postcss-normalize-whitespace": "^5.1.0"
16
18
  },
17
19
  "repository": "cssnano/cssnano",
18
20
  "homepage": "https://github.com/cssnano/cssnano",
package/src/index.js CHANGED
@@ -4,11 +4,20 @@ const postcssNormalizeWhitespace = require('postcss-normalize-whitespace');
4
4
  const postcssDiscardEmpty = require('postcss-discard-empty');
5
5
  const { rawCache } = require('cssnano-utils');
6
6
 
7
- const defaultOpts = {};
7
+ /** @typedef {false | { exclude?: true} }SimpleOptions */
8
+ /** @typedef {{discardComments?: false | import('postcss-discard-comments').Options & { exclude?: true},
9
+ normalizeWhitespace?: SimpleOptions,
10
+ discardEmpty?: SimpleOptions,
11
+ rawCache?: SimpleOptions}} Options */
8
12
 
13
+ const defaultOpts = {};
14
+ /**
15
+ * @param {Options} opts
16
+ * @return {{plugins: [import('postcss').PluginCreator<any>, false | Record<string, any> | undefined][]}}
17
+ */
9
18
  module.exports = function defaultPreset(opts = {}) {
10
19
  const options = Object.assign({}, defaultOpts, opts);
11
-
20
+ /** @type {[import('postcss').PluginCreator<any>, false | Record<string, any> | undefined][]} **/
12
21
  const plugins = [
13
22
  [postcssDiscardComments, options.discardComments],
14
23
  [postcssNormalizeWhitespace, options.normalizeWhitespace],
@@ -0,0 +1,16 @@
1
+ declare function _exports(opts?: Options): {
2
+ plugins: [import('postcss').PluginCreator<any>, false | Record<string, any> | undefined][];
3
+ };
4
+ export = _exports;
5
+ export type SimpleOptions = false | {
6
+ exclude?: true;
7
+ };
8
+ export type Options = {
9
+ discardComments?: false | import('postcss-discard-comments').Options & {
10
+ exclude?: true;
11
+ };
12
+ normalizeWhitespace?: SimpleOptions;
13
+ discardEmpty?: SimpleOptions;
14
+ rawCache?: SimpleOptions;
15
+ };
16
+ import { rawCache } from "cssnano-utils";