Merge branch 'config' into pnpm

This commit is contained in:
Mr.Hope
2023-04-24 21:32:49 +08:00

View File

@@ -1,21 +1,32 @@
import { defineUserConfig } from "vuepress"; import { defineUserConfig } from "vuepress";
import { viteBundler } from '@vuepress/bundler-vite' import { viteBundler } from "@vuepress/bundler-vite";
import theme from "./theme.js"; import { docsearchPlugin } from "@vuepress/plugin-docsearch";
import { autoCatalogPlugin } from "vuepress-plugin-auto-catalog"; import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
import { redirectPlugin } from "vuepress-plugin-redirect"; import { redirectPlugin } from "vuepress-plugin-redirect";
import theme from "./theme.js";
export default defineUserConfig({ export default defineUserConfig({
base: "/", base: "/",
dest: "./dist", dest: "./dist",
head:[ head: [
['script', {async:"", defer:"", "data-website-id":"f586534f-1741-450e-a0f4-3c0189f993c9", [
src:"https://umami.irain.in/umami.js"}, ` "script",
`], {
['script', {type: "module", src:"https://get.microsoft.com/badge/ms-store-badge.bundled.js"}], src: "https://umami.irain.in/umami.js",
"data-website-id": "f586534f-1741-450e-a0f4-3c0189f993c9",
async: "",
defer: "",
},
],
[
"script",
{
type: "module",
src: "https://get.microsoft.com/badge/ms-store-badge.bundled.js",
},
],
], ],
locales: { locales: {
"/zh/": { "/zh/": {
@@ -38,8 +49,8 @@ export default defineUserConfig({
locales: { locales: {
"/zh/": { "/zh/": {
placeholder: "搜索文档", placeholder: "搜索文档",
translations:{ translations: {
button:{ button: {
buttonText: "搜索文档", buttonText: "搜索文档",
buttonAriaLabel: "搜索文档", buttonAriaLabel: "搜索文档",
}, },
@@ -75,30 +86,29 @@ export default defineUserConfig({
reportMissingResultsLinkText: "点击反馈", reportMissingResultsLinkText: "点击反馈",
}, },
}, },
} },
}, },
"/en/": { "/en/": {
placeholder: "Search documents", placeholder: "Search documents",
translations:{ translations: {
button:{ button: {
buttonText: "Search documents" buttonText: "Search documents",
} },
} },
} },
} },
}), }),
googleAnalyticsPlugin({ googleAnalyticsPlugin({
id: "G-F3LFJCE3RM" id: "G-F3LFJCE3RM",
}), }),
redirectPlugin({ redirectPlugin({
defaultLocale: "/en/", defaultLocale: "/en/",
defaultBehavior: "defaultLocale",
autoLocale: true, autoLocale: true,
switchLocale: "modal", switchLocale: "modal",
localeConfig: { localeConfig: {
"/en/": ["en-US", "en-UK", "en"], "/en/": ["en-US", "en-UK", "en"],
"/zh/": ["zh-CN", "zh-TW", "zh"], "/zh/": ["zh-CN", "zh-TW", "zh"],
} },
}), }),
], ],
@@ -108,10 +118,9 @@ export default defineUserConfig({
bundler: viteBundler({ bundler: viteBundler({
viteOptions: { viteOptions: {
build:{ build: {
chunkSizeWarningLimit: 1500 chunkSizeWarningLimit: 1500,
} },
}, },
vuePluginOptions: {},
}), }),
}); });