fix: always set `base` to `/` in dev mode to avoid broken links

pull/105/head
Kia Ishii 5 years ago
parent 123cc73837
commit d7ef24909f

@ -41,6 +41,13 @@ export async function resolveConfig(
const userConfig = await resolveUserConfig(root)
const site = await resolveSiteData(root)
// force base path to be `/` when it's running in a non-production
// environment. currently, it's hard to implement `base` feature while
// making it work with Vite HMR, and this is an easy workaround.
if (process.env.NODE_ENV !== 'production') {
site.base = '/'
}
// resolve theme path
const userThemeDir = resolve(root, 'theme')
const themeDir = (await fs.pathExists(userThemeDir))

Loading…
Cancel
Save