There are a variety of positive and negative results on this topic, depending on the Easton function and the set-theoretic background.
The Kunen-Paris theorem, for example, provides a large number of positive instances.
Theorem. If $\kappa$ is a measurable cardinal and $2^\kappa=\kappa^+$, then for any Easton function $E:A\to\kappa$ defined on a set $A\subset\kappa$ of regular cardinals below $\kappa$, with $A\notin\mu$ for some normal measure $\mu$ on $\kappa$, then in the Easton forcing extension $V[G]$, the cardinal $\kappa$ remains measurable.
Proof. Let $\newcommand\P{\mathbb{P}}\P$ be the Easton forcing for $E$, and suppose that $G\subset\P$ is $V$-generic. Let $j:V\to M$ be the ultrapower by $\mu$. If you consider $j(\P)$, you can factor it at $\kappa$ and see that $j(\P)=\P\times\P^*$, where $\P^*$ is the forcing beyond stage $\kappa$. There is no forcing at coordinate $\kappa$ precisely because $\kappa\notin j(A)$. It follows that $\P^*$ is $\leq\kappa$-closed in $M$. Furthermore, the size of $\P^*$ is $|j(\kappa)|^M$, and so the number of subsets of it in $M$ is $|j(2^\kappa)|^M=|j(\kappa^+)|^M$, and this is $\kappa^+$ in $V$, since $(\kappa^+)^\kappa=\kappa^+$. So in $V$ we may line up the dense subsets of $\P^*$ in $M$ into a $\kappa^+$ sequence. Since $M^\kappa\subset M$, we may therefore perform a diagonalization to build in $V$ an $M$-generic filter $G^*\subset\P^*$, simply by meeting the dense sets one-by-one. Since $G$ is $V$-generic, it is also $M[G^*]$-generic, and so $G\times G^*$ is $M$-generic for $j(\P)$. This filter fulfills the lifting criterion, and so we may lift the embedding to $j:V[G]\to M[j(G)]$, with $j(G)=G\times G^*$. Thus, $\kappa$ remains measurable in $V[G]$, as desired.
$\Box$
Note that the assumption $2^\kappa=\kappa^+$ can be easily forced without adding subsets to $\kappa$ and thefore while preserving the measurability of $\kappa$. So the argument is applicable to any measurable cardinal, whether or not the GCH holds at $\kappa$, provided one also forces $2^\kappa=\kappa^+$.
Since the construction of $G^*$ has wide flexibility, there are many such $G^*$ and consequently it follows that in $V[G]$ there are $2^{2^\kappa}$ many normal measures on $\kappa$. This is how Kunen and Paris proved the consistency of having many normal measures on a measurable cardinal.
There are many similar further such lifting arguments in many of my papers, but let me point you to:
Using results in that paper, one can show that $\kappa$ is not necessarily the least measurable cardinal in $V[G]$, since it could be that the measurability of some smaller cardinal is turned on by the forcing.
The general case of $A\in\mu$ is not always possible, since if you control some pattern of the continuum function on a set $A$ of measure one, this will have consequences for the continuum function at $\kappa$ itself in $M$. And so the general rule is that the function $E$ must exhibit certain kinds of self-reference in order to be able to preserve the large cardinal property at $\kappa$.
Another limitation or negative result is that the consistency strength of $\kappa$ is measurable plus $2^\kappa>\kappa^+$ is strictly stronger than a measurable cardinal. One needs $\kappa$ to be $\kappa^{++}$-tall. (See my paper,
Hamkins, Joel D., Tall cardinals, Doi:10.1002/malq.200710084, Math. Log. Q. 55, No. 1, 68-86 (2009). ZBL1165.03044, blog post.) So it will be necessary to start with a larger large cardinal situation if this is desired.
Meanwhile, one can achieve a large number of positive instances when one begins with a supercompact cardinal. In many of these cases it is often easier to use the Easton-support iteration rather than the Easton product forcing.
There is a whole literature on combining Easton's theorem with large cardinals, and perhaps people can post further references. Let me mention a few papers of Brent Cody, who first looked at this topic in his disseration (under my supervision).
- Cody, Brent, Easton’s theorem in the presence of Woodin cardinals, Arch. Math. Logic 52, No. 5-6, 569-591 (2013). ZBL1305.03039.
Cody, Brent; Friedman, Sy-David; Honzik, Radek, Easton functions and supercompactness, Fundam. Math. 226, No. 3, 279-296 (2014). ZBL1341.03069.
Cody, Brent; Gitman, Victoria, Easton’s theorem for Ramsey and strongly Ramsey cardinals, Ann. Pure Appl. Logic 166, No. 9, 934-952 (2015). ZBL1371.03064.