@unocss/postcss 0.50.2 → 0.50.4

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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const promises = require('fs/promises');
3
+ const promises = require('node:fs/promises');
4
4
  const fg = require('fast-glob');
5
5
  const postcss = require('postcss');
6
6
  const core = require('@unocss/core');
@@ -164,15 +164,15 @@ function unocss(options = {}) {
164
164
  );
165
165
  const {
166
166
  cwd = process.cwd(),
167
- directiveMap = {
168
- apply: "apply",
169
- theme: "theme",
170
- screen: "screen",
171
- unocss: "unocss"
172
- },
173
167
  content,
174
168
  configOrPath
175
169
  } = options;
170
+ const directiveMap = Object.assign({
171
+ apply: "apply",
172
+ theme: "theme",
173
+ screen: "screen",
174
+ unocss: "unocss"
175
+ }, options.directiveMap || {});
176
176
  const fileMap = /* @__PURE__ */ new Map();
177
177
  const fileClassMap = /* @__PURE__ */ new Map();
178
178
  const classes = /* @__PURE__ */ new Set();
@@ -308,5 +308,6 @@ function unocss(options = {}) {
308
308
  };
309
309
  }
310
310
  unocss.postcss = true;
311
+ unocss.default = unocss;
311
312
 
312
313
  module.exports = unocss;
package/dist/index.d.ts CHANGED
@@ -7,10 +7,10 @@ interface UnoPostcssPluginOptions {
7
7
  extension: string;
8
8
  })[];
9
9
  directiveMap?: {
10
- apply: string;
11
- screen: string;
12
- theme: string;
13
- unocss: string;
10
+ apply?: string;
11
+ screen?: string;
12
+ theme?: string;
13
+ unocss?: string;
14
14
  };
15
15
  cwd?: string;
16
16
  configOrPath?: string | UserConfig;
@@ -21,7 +21,9 @@ declare function unocss(options?: UnoPostcssPluginOptions): {
21
21
  plugins: ((root: Root, result: Result) => Promise<void>)[];
22
22
  };
23
23
  declare namespace unocss {
24
- var postcss: boolean;
24
+ export var postcss: boolean;
25
+ var _a: typeof unocss;
26
+ export { _a as default };
25
27
  }
26
28
 
27
29
  export { UnoPostcssPluginOptions, unocss as default };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { stat, readFile } from 'fs/promises';
1
+ import { stat, readFile } from 'node:fs/promises';
2
2
  import fg from 'fast-glob';
3
3
  import postcss from 'postcss';
4
4
  import { expandVariantGroup, notNull, regexScopePlaceholder, warnOnce, createGenerator } from '@unocss/core';
@@ -156,15 +156,15 @@ function unocss(options = {}) {
156
156
  );
157
157
  const {
158
158
  cwd = process.cwd(),
159
- directiveMap = {
160
- apply: "apply",
161
- theme: "theme",
162
- screen: "screen",
163
- unocss: "unocss"
164
- },
165
159
  content,
166
160
  configOrPath
167
161
  } = options;
162
+ const directiveMap = Object.assign({
163
+ apply: "apply",
164
+ theme: "theme",
165
+ screen: "screen",
166
+ unocss: "unocss"
167
+ }, options.directiveMap || {});
168
168
  const fileMap = /* @__PURE__ */ new Map();
169
169
  const fileClassMap = /* @__PURE__ */ new Map();
170
170
  const classes = /* @__PURE__ */ new Set();
@@ -300,5 +300,6 @@ function unocss(options = {}) {
300
300
  };
301
301
  }
302
302
  unocss.postcss = true;
303
+ unocss.default = unocss;
303
304
 
304
305
  export { unocss as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/postcss",
3
- "version": "0.50.2",
3
+ "version": "0.50.4",
4
4
  "description": "PostCSS plugin for UnoCSS",
5
5
  "author": "sibbng <sibbngheid@gmail.com>",
6
6
  "license": "MIT",
@@ -36,12 +36,12 @@
36
36
  "postcss": "^8.4.21"
37
37
  },
38
38
  "dependencies": {
39
- "@unocss/config": "0.50.2",
40
- "@unocss/core": "0.50.2",
41
39
  "css-tree": "^2.3.1",
42
40
  "fast-glob": "^3.2.12",
43
41
  "magic-string": "^0.30.0",
44
- "postcss": "^8.4.21"
42
+ "postcss": "^8.4.21",
43
+ "@unocss/config": "0.50.4",
44
+ "@unocss/core": "0.50.4"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "unbuild",