Add spm support

New PR from https://github.com/yyx990803/vue/pull/283