improve bundle task
better cross-environment support