Closed chase-moskal closed 2 weeks ago
👋 hey, love the library, i've used it for years for many projects, it's my go-to!
Thank you!
The next step here would be to run a quick experiment on what's needed with minifiers these days.
From a quick test with the terser REPL and uglifyjs it looks like
const F2 = 0.5 * (/*#__PURE__*/Math.sqrt(3.0) - 1.0);
should work universally.
@chase-moskal Is there any easy way to test whether this would also make rollup happy?
👋 hey, love the library, i've used it for years for many projects, it's my go-to!
Thank you!
The next step here would be to run a quick experiment on what's needed with minifiers these days.
From a quick test with the terser REPL and uglifyjs it looks like
const F2 = 0.5 * (/*#__PURE__*/Math.sqrt(3.0) - 1.0);
should work universally.
@chase-moskal Is there any easy way to test whether this would also make rollup happy?
Rollup also has a REPL and your suggested fix seems to make it happy:
const F2 = /*#__PURE__*/ 0.5 * (Math.sqrt(3.0) - 1.0);
) showing warningconst F2 = 0.5 * (/*#__PURE__*/Math.sqrt(3.0) - 1.0);
) with no warningFix released in 4.0.2. :)
:wave: hey, love the library, i've used it for years for many projects, it's my go-to!
i noticed rollup is complaining about the
#__PURE__
comments -- glancing at rollup's docs, i think it just wants these annotations positioned before theconst
?i suspect a change like this might make both uglify and rollup happy? i'm using terser, which apparently supports these same kinds of annotations.
rollup's warning, literally complaining about the meta-comment
// these #__PURE__ comments help uglifyjs with dead code removal
which is kinda funnyanother rollup warning about the next line
this obviously is not a critical issue.