Closed MrMarmo closed 7 months ago
The obfuscator does not directly work with the files inside the src
. It only obfuscates code under the .next
folder, which is the NextJS build folder, so it should not be an issue. Version 2.0.0 will be out this weekend and you will get better docs, demos and config. Please wait for it.
Sorry. i did mean in the .next folder. see how gap-2 has a "\n" in the compiled js.
2.0 might have fixed this.
Why there are \n in the compiled JS? This is not supposed to happen. May I have the related part of the source code?
maybe its just a mac thing. idk if it happening on linux. This is just a normal .tsx file compiled with "next build"
{ whoAmI.user_role >= 2 &&
<button className={`text-lg w-full text-left p-2 flex gap-2
hover:bg-gray-100 dark:hover:bg-slate-700
${tab == "bots" && "bg-gray-100 dark:bg-slate-600" }`}
onClick={() => router.push(`/settings/bots`)}
>
<svg className='flex-shrink-0 w-6 h-6 fill-black dark:fill-white' xmlns="http://www.w3.org/2000/svg" viewBox="-3 0 24 24">
<path d="m22.3 16.7 1.4-1.4-3.7-3.7-5.8 5.8c-.5-.3-1.1-.4-1.7-.4-1.9 0-3.5 1.6-3.5 3.5s1.6 3.5 3.5 3.5 3.5-1.6 3.5-3.5c0-.6-.2-1.2-.4-1.7l1.9-1.9 2.3 2.3 1.4-1.4-2.3-2.3 1.1-1.1 2.3 2.3zM12.5 22c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5z"/>
<path d="M2 19c0-3.9 3.1-7 7-7 2 0 3.9.9 5.3 2.4l1.5-1.3c-.9-1-1.9-1.8-3.1-2.3C14.1 9.7 15 7.9 15 6c0-3.3-2.7-6-6-6S3 2.7 3 6c0 1.9.9 3.7 2.4 4.8C2.2 12.2 0 15.3 0 19v5h8v-2H2v-3zM5 6c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z"/>
</svg>
Bots
</button>}
ok, so setting line 151 in utils.js, in 2.0, to this regex = new RegExp(`([\\s"'\\\`]|^)(${keyUse})(?=$|[\\s"'\\\`]|\\\\n)`, 'g');
fixes it still. but idk if i will break any thing else. prob not.
without change:
with change:
When having a className, in a .tsx, that spans multiple lines, if the last class name, in any line, doesn't have a space after it, it doesn't get replaced during the obfuscate-build.
fixed it with "
regex = new RegExp(`([\\s"'\\\`]|^)(${keyUse})(?=$|[\\s"'\\\`]|\\\\n)`, 'g');
" in utils.js