@plumeria/turbopack-loader 13.0.2 → 13.1.1
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.js +9 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ const zss_engine_1 = require("zss-engine");
|
|
|
41
41
|
const utils_1 = require("@plumeria/utils");
|
|
42
42
|
let lastValidCss = '';
|
|
43
43
|
function cleanStaleThemeRules(currentCss, optInCss) {
|
|
44
|
-
const hashRegex = /--([a-z0-9]{8})-[a-zA-Z0-9-]
|
|
44
|
+
const hashRegex = /--([a-z0-9]{8})-[a-zA-Z0-9-]+:/g;
|
|
45
45
|
const hashes = new Set();
|
|
46
46
|
let match;
|
|
47
47
|
while ((match = hashRegex.exec(optInCss)) !== null) {
|
|
@@ -49,9 +49,15 @@ function cleanStaleThemeRules(currentCss, optInCss) {
|
|
|
49
49
|
}
|
|
50
50
|
let cleanedCss = currentCss;
|
|
51
51
|
for (const hash of hashes) {
|
|
52
|
-
const
|
|
53
|
-
cleanedCss = cleanedCss.replace(
|
|
52
|
+
const propRegex = new RegExp(`--${hash}-[a-zA-Z0-9-]+:[^;}]+(?:;|(?=\\}))`, 'g');
|
|
53
|
+
cleanedCss = cleanedCss.replace(propRegex, '');
|
|
54
54
|
}
|
|
55
|
+
const emptyBlockRegex = /(?<=^|[}])[^{}]*\{\s*\}/g;
|
|
56
|
+
let prevCss;
|
|
57
|
+
do {
|
|
58
|
+
prevCss = cleanedCss;
|
|
59
|
+
cleanedCss = cleanedCss.replace(emptyBlockRegex, '');
|
|
60
|
+
} while (cleanedCss !== prevCss);
|
|
55
61
|
return cleanedCss.trim();
|
|
56
62
|
}
|
|
57
63
|
async function loader(source) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/turbopack-loader",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.1",
|
|
4
4
|
"description": "Plumeria Turbopack-loader",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"zero-virtual.css"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@plumeria/utils": "^13.
|
|
25
|
+
"@plumeria/utils": "^13.1.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@swc/core": "1.15.40",
|