check if dist dir exists in build.js

build.js need to check if dist dir exists, if not, create first