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);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { resolve } from 'node:path';
|
||||
|
||||
import {
|
||||
viteArchiverPlugin,
|
||||
viteDayjsPlugin,
|
||||
viteVxeTableImportsPlugin,
|
||||
} from '@vben/vite-config';
|
||||
|
||||
@@ -69,6 +70,7 @@ export const shared = defineConfig({
|
||||
stringify: true,
|
||||
},
|
||||
plugins: [
|
||||
viteDayjsPlugin(),
|
||||
tailwindcss(),
|
||||
GitChangelog({
|
||||
mapAuthors: [
|
||||
@@ -86,6 +88,7 @@ export const shared = defineConfig({
|
||||
username: 'likui628',
|
||||
},
|
||||
{
|
||||
mapByNameAliases: ['Jin Mao', 'jinmao'],
|
||||
name: 'Jin Mao',
|
||||
username: 'jinmao88',
|
||||
},
|
||||
@@ -94,6 +97,7 @@ export const shared = defineConfig({
|
||||
username: 'mynetfan',
|
||||
},
|
||||
{
|
||||
mapByNameAliases: ['xingyu4j', 'xingyu'],
|
||||
name: 'xingyu4j',
|
||||
username: 'xingyu4j',
|
||||
},
|
||||
@@ -115,6 +119,7 @@ export const shared = defineConfig({
|
||||
|
||||
ssr: {
|
||||
external: ['@vue/repl'],
|
||||
noExternal: ['@v-c/picker'],
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -125,7 +130,7 @@ function head(): HeadConfig[] {
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
content: 'vben, vitejs, vite, shacdn-ui, vue',
|
||||
content: 'vben, vitejs, vite, shadcn-ui, vue',
|
||||
name: 'keywords',
|
||||
},
|
||||
],
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
"name": "@vben/docs",
|
||||
"version": "5.7.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vitepress build",
|
||||
"build": "cross-env NODE_OPTIONS=\"--import ./.vitepress/build/dayjs-loader.mjs\" vitepress build",
|
||||
"dev": "vitepress dev",
|
||||
"docs:preview": "vitepress preview"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user