You could try optimizing your code…
For example you are calling getMousePos 4 times in your mouseMove function.
Call it once and assign the value to a vector3D that’s declared once, outside the function.
i.e let currentMousePos = new THREE.Vector3();
And at the start of the move call currentMousePos = getMousePos(e);
First, your getMousePos function is returning a value in screen space [-1,1]. So the difference between 2 mouse moves will be very small and not related at all to the Object size.
For this kind of transformation I would advise to work in world space : get the actual 3D point. Best practice is to use unproject as proposed by drcmda, since this would make your code independant from the camera.
You can even keep the Z component to ensure your code work with any kind of projection and from any viewing direction.
From there you will get two 3D points corresponding to the mouse move.
Let’s call dX and dY the distance variations in X and Y.
Let’s call Box the current axis aligned bounding box of your object.
Scaling your object in X is adding 2 * dX to the current Object size which is Box.getSize().x.
So the scaling factor to apply to the current object will be something like sX = 1 + 2*dX / Box.getSize().x
But since the object may already be scaled, you need to multiply this with the current scale value, not add it.
Another good practice is to refer to the original position / scale of your object (ie their values on the mouse down event), during all the scaling action. This will prevent small rounding errors to accumulate.