Fix a bug when base is set to root path
Add spec for data-main