Closed hoangnhan2ka3 closed 5 months ago
As a temporary solution, add the following to the config
classIgnore = ["dark", "light"]
I will get back to the issue after a month.
Yes, I will. My issues all want to aim for a config file
that doesn't require much adjustment and is as simple as possible, I hope you understand.
Also, what are you busy with in the next month?
Mate, I can't eat with open source.
Feel free to check out, https://github.com/soranoo/Donation https://github.com/sponsors/soranoo
Sooo embarrassing, very sorry, I'm just a student, I can't help you any more than helping your package become more perfect so that more people can pay attention to it, at some point it will definitely work, keep trying. Come on up.
This is the first time in half a year that I have come into contact with Front-end development and I am so interested in a package.
I still dream that one day Facebook will buy this package, they created StyleX because they somehow hate Tailwind's cumbersome classes :)))
Something wrong :)))
If you need a real demo, I will update to the previous repo I shared with you after I finished lunch
May I have the related HTML file(.html
) (both before and after obfuscation) and the conversion.json
?
No obfuscation:
With obfuscation:
conversion.json
:
Please wait a minute, I will update the repo
@soranoo I updated, but now I'm using pnpm
so let run pnpm install
All expected behavior is at hoangnhan.uk (except https://github.com/soranoo/next-css-obfuscator/issues/27)
Files related to this issue:
./src/scripts/theme-script.ts
./src/components/ModeToggle.tsx
component <ThemeScript />
in ./src/app/layout.tsx
(head tag)
And what is your expected output? for the html file
No, maybe you misunderstood something.
The data-theme
attribute only appears at runtime, but in the static html
file it will not.
data-theme
appears through this script in the head
tag (which was created by theme-script.ts
):
Basically after run build
, everything is fine, however when running with the current 2.2.10
version, as I said above
Expected behavior
[data-theme]
is not aclassName
so...dark
andlight
in[data-theme]="dark"
or[data-theme]="light"
is shouldn't be obfuscated.
Screenshots
First load on the website maybe was right, but try add a
toggle
and press it:
In
conversion.json
:
And things are even worse in the canary
version...
I noticed that there is not a word data-theme
in theme-script.ts
(but created by document.documentElement.dataset.theme
), so how can u make this pkg realize that dark
and light
should not be obfuscated there?
Or perhaps in the end, the best way is still to add dark
and light
to the whitelist heh 🤔. I don't see any ways...
I hadn't released the patch as an official release. So if you like to check out the canary, you have to npm/pnpm I -D next-css-obfuscator@beta
Because 2.2.11
and 2.2.11-beta.2
broke the site in https://github.com/soranoo/next-css-obfuscator/issues/27 so I'm not able to check this issue yet
Solved, but problem remain https://github.com/soranoo/next-css-obfuscator/issues/30
Because
2.2.11
and2.2.11-beta.2
broke the site in #27 so I'm not able to check this issue yet
[For future reference - DEV]
The error - "Minified react error #148" is due to
<!--$-->
)<br/>
valid, <br></br>
invalid)<noscript />
tag, but it depend on next build
, I can't control that (?):Im still working on it.
Solved in v2.2.14-beta.2
& v2.2.14-beta.5
Type
Checklist
Environment
Describe the bug
dark
andlight
in [data-theme] attribute of tag were detected as classNameTo Reproduce Steps to reproduce the behavior:
./src/theme-script.tsx
Expected behavior
[data-theme]
is not aclassName
so...dark
andlight
in[data-theme]="dark"
or[data-theme]="light"
is shouldn't be obfuscated.Screenshots
First load on the website maybe was right, but try add a
toggle
and press it:In
conversion.json
:Config
Related files
Obfuscated
version: 97fb199871848870.css.txtDemos (if any) N/A
Additional context ...