Closed hoangnhan2ka3 closed 7 months ago
I don't see any problem with the extraction regex
hmmm why
I tried delete both .next/cache
and css-obfuscator
folder but nothing change
Maybe the problem is that rounded-none
or border-none
haven't been obfuscated, it's a valid TW class?
The regex doesn't specifically match the Tailwind class, it matches all words
Hmmm... so why max-h-full
and p-0
have been obfuscated but not rounded-none
, border-none
or outline-none
?
I guess it's not a problem with the word none
:)))
Maybe it's truth @soranoo
I found I forgot to ask for ur config.
May I have your config file?
For now:
module.exports = {
enable: true, // Enable or disable the plugin.
mode: "predictable", // Obfuscate mode, "random" or "simplify".
buildFolderPath: ".next", // Build folder of your project.
classConversionJsonFolderPath: "./css-obfuscator", // The folder path to store the before obfuscate and after obfuscated classes conversion table.
refreshClassConversionJson: false, // Refresh the class conversion JSON file.
classLength: 6, // Length of the obfuscated class name.
classPrefix: "", // Prefix of the obfuscated class name.
classSuffix: "", // Suffix of the obfuscated class name.
classIgnore: [
"no",
"dark",
"light",
"no-transition",
"opa-hidden",
"big",
"small",
/lenis*/
], // The class names to be ignored during obfuscation.
allowExtensions: [".jsx", ".tsx", ".js", ".ts", ".html", ".rsc"], // The file extensions to be processed.
contentIgnoreRegexes: [/\.jsxs\)\("\w+"/g], // The regexes to match the file content to be ignored during obfuscation.
whiteListedFolderPaths: [], // Only obfuscate files in these folders
blackListedFolderPaths: ["./.next/cache"], // Don't obfuscate files in these folders
enableMarkers: false, // Enable or disable the obfuscate marker classes.
markers: ["obf"], // Classes that indicate component(s) need to obfuscate.
removeMarkersAfterObfuscated: true, // Remove the obfuscation markers from HTML elements after obfuscation.
removeOriginalCss: true, // Delete original CSS from CSS files if it has a obfuscated version.
generatorSeed: 840817818898, // The seed for the random generator.
logLevel: "info", // Log level
};
Hmmm I don't think....
Oh yes sir :))))))
After remove
It's OK now:
Why, it's not a regex
Btw would you mind giving a meaningful issue title next time?
yes yes, my fault 🫡
And the contestant this time is
has-[foo]:
Please refer to: Styling based on descendants (has-{modifier})
Some obfuscated ✅, some not ⛔:
Replaced ✅ (No style lost):
Have another nice day 💕