diff --git a/src/node/config.ts b/src/node/config.ts index 3df6646c..33dd4084 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -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))