In the answer https://math.stackexchange.com/a/2888901/ it is claimed that since the connected component of the identity of the infinite-dimensional Lie group $\mathrm{Diff}(M)$ (with $M$ compact) is known to be perfect, then its Lie algebra $\mathrm{Vect}(M)$ (vector fields on $M$) is also perfect. I worry about the technical details of this. I'm happy just to know that $\mathrm{Vect}(M)$ is only topologically perfect (the derived algebra is merely dense in the whole algebra).
In what generality can you say this claim is true? Let us restrict to Milnor-regular Lie groups, to avoid any of the nastier examples of infinite-dimensional Lie groups and algebras.
I'm still not sure about about the implication asked about, it's probably not a formal statement ($\mathrm{Diff}(M)$ is not a locally exponential group, so I believe one needs to do something other than rely on perfectness of the group to get perfectness of the algebra).
But, the result claimed is true, by Theorem 1.4.3 in
and in fact more: for non-compact $M$, the Lie algebra of compactly-supported vector fields on $M$ is perfect.