How can I prevent texture stretching while scaling a mesh?

Pay attention to transform node, it should convert world to local space.