@unocss/extractor-arbitrary-variants 0.55.7 → 0.56.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/dist/index.cjs CHANGED
@@ -4,6 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const core = require('@unocss/core');
6
6
 
7
+ const sourceMapRE = /\/\/#\s*sourceMappingURL=.*\n?/g;
8
+ function removeSourceMap(code) {
9
+ if (code.includes("sourceMappingUrl="))
10
+ return code.replace(sourceMapRE, "");
11
+ return code;
12
+ }
13
+
7
14
  const quotedArbitraryValuesRE = /(?:[\w&:[\]-]|\[\S+=\S+\])+\[\\?['"]?\S+?['"]\]\]?[\w:-]*/g;
8
15
  const arbitraryPropertyRE = /\[(\\\W|[\w-])+:[^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?\]/g;
9
16
  const arbitraryPropertyCandidateRE = /^\[(\\\W|[\w-])+:['"]?\S+?['"]?\]$/;
@@ -26,7 +33,7 @@ const extractorArbitraryVariants = {
26
33
  name: "@unocss/extractor-arbitrary-variants",
27
34
  order: 0,
28
35
  extract({ code }) {
29
- return splitCodeWithArbitraryVariants(code);
36
+ return splitCodeWithArbitraryVariants(removeSourceMap(code));
30
37
  }
31
38
  };
32
39
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,12 @@
1
1
  import { defaultSplitRE, isValidSelector } from '@unocss/core';
2
2
 
3
+ const sourceMapRE = /\/\/#\s*sourceMappingURL=.*\n?/g;
4
+ function removeSourceMap(code) {
5
+ if (code.includes("sourceMappingUrl="))
6
+ return code.replace(sourceMapRE, "");
7
+ return code;
8
+ }
9
+
3
10
  const quotedArbitraryValuesRE = /(?:[\w&:[\]-]|\[\S+=\S+\])+\[\\?['"]?\S+?['"]\]\]?[\w:-]*/g;
4
11
  const arbitraryPropertyRE = /\[(\\\W|[\w-])+:[^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?\]/g;
5
12
  const arbitraryPropertyCandidateRE = /^\[(\\\W|[\w-])+:['"]?\S+?['"]?\]$/;
@@ -22,7 +29,7 @@ const extractorArbitraryVariants = {
22
29
  name: "@unocss/extractor-arbitrary-variants",
23
30
  order: 0,
24
31
  extract({ code }) {
25
- return splitCodeWithArbitraryVariants(code);
32
+ return splitCodeWithArbitraryVariants(removeSourceMap(code));
26
33
  }
27
34
  };
28
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/extractor-arbitrary-variants",
3
- "version": "0.55.7",
3
+ "version": "0.56.0",
4
4
  "description": "Extractor arbitrary variants for utilities",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@unocss/core": "0.55.7"
36
+ "@unocss/core": "0.56.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild",