fix: doc build error
This commit is contained in:
2
docs/.vitepress/build/dayjs-loader.mjs
Normal file
2
docs/.vitepress/build/dayjs-loader.mjs
Normal file
@@ -0,0 +1,2 @@
|
||||
import { register } from 'node:module';
|
||||
register('./dayjs-resolve-hook.mjs', import.meta.url);
|
||||
10
docs/.vitepress/build/dayjs-resolve-hook.mjs
Normal file
10
docs/.vitepress/build/dayjs-resolve-hook.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
const DAYJS_SUBPATH_RE = /^dayjs\/(plugin|locale)\/([^./]+)$/;
|
||||
|
||||
/** @type {import('node:module').ResolveHook} */
|
||||
export async function resolve(specifier, context, nextResolve) {
|
||||
const match = specifier.match(DAYJS_SUBPATH_RE);
|
||||
if (match) {
|
||||
return nextResolve(`${specifier}.js`, context);
|
||||
}
|
||||
return nextResolve(specifier, context);
|
||||
}
|
||||
Reference in New Issue
Block a user