Chore: upgrade to vuepress@next-beta.12
parent
31dc1094ff
commit
6a6b1a175e
|
@ -1,4 +1,5 @@
|
||||||
import { defineUserConfig, DefaultThemeOptions } from "vuepress";
|
import { defineUserConfig } from "@vuepress/cli";
|
||||||
|
import type { DefaultThemeOptions } from "@vuepress/theme-default";
|
||||||
import * as sidebar from "./config/sidebar";
|
import * as sidebar from "./config/sidebar";
|
||||||
import * as navbar from "./config/navbar";
|
import * as navbar from "./config/navbar";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
|
@ -8,23 +9,20 @@ const isProduction = process.env.NODE_ENV === "production";
|
||||||
export default defineUserConfig<DefaultThemeOptions>({
|
export default defineUserConfig<DefaultThemeOptions>({
|
||||||
theme: path.join(__dirname, "./theme"),
|
theme: path.join(__dirname, "./theme"),
|
||||||
plugins: [
|
plugins: [
|
||||||
["@vuepress/back-to-top"],
|
|
||||||
["vuepress-plugin-mermaidjs"],
|
["vuepress-plugin-mermaidjs"],
|
||||||
[
|
[
|
||||||
"@vuepress/plugin-search",
|
"@vuepress/plugin-search",
|
||||||
{
|
{
|
||||||
locales: {
|
locales: {
|
||||||
"/": {
|
"/": {
|
||||||
placeholder: "Search",
|
|
||||||
},
|
|
||||||
"/zh/": {
|
|
||||||
placeholder: "搜索",
|
placeholder: "搜索",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
["@vuepress/plugin-debug", !isProduction],
|
||||||
],
|
],
|
||||||
base: "/Xray-docs-next/",
|
base: isProduction ? "/Xray-docs-next/" : "",
|
||||||
locales: {
|
locales: {
|
||||||
"/": {
|
"/": {
|
||||||
lang: "zh-CN",
|
lang: "zh-CN",
|
||||||
|
@ -42,7 +40,7 @@ export default defineUserConfig<DefaultThemeOptions>({
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
|
|
||||||
themePlugins: {
|
themePlugins: {
|
||||||
git: process.env.NODE_ENV === "production",
|
git: isProduction,
|
||||||
},
|
},
|
||||||
locales: {
|
locales: {
|
||||||
"/": {
|
"/": {
|
||||||
|
@ -89,7 +87,7 @@ export default defineUserConfig<DefaultThemeOptions>({
|
||||||
extendsMarkdown: (md) => {
|
extendsMarkdown: (md) => {
|
||||||
md.use(require("markdown-it-footnote"));
|
md.use(require("markdown-it-footnote"));
|
||||||
},
|
},
|
||||||
//bundler: isProduction ? "@vuepress/webpack" : "@vuepress/vite",
|
bundler: isProduction ? "@vuepress/webpack" : "@vuepress/vite",
|
||||||
bundlerConfig: {
|
bundlerConfig: {
|
||||||
chainWebpack: (config) => {
|
chainWebpack: (config) => {
|
||||||
config.module
|
config.module
|
||||||
|
@ -101,6 +99,9 @@ export default defineUserConfig<DefaultThemeOptions>({
|
||||||
name: `assets/img/[name].[hash:8].[ext]`,
|
name: `assets/img/[name].[hash:8].[ext]`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
viteOptions: {
|
||||||
|
base: "/Xray-docs-next/",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
//postcss: { plugins: [require("autoprefixer")] }
|
//postcss: { plugins: [require("autoprefixer")] }
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,9 +42,12 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
const bootstrap = require("bootstrap");
|
import("bootstrap").then((b) => {
|
||||||
let triggerEl = document.getElementById(this.children["0"].$data.labelID);
|
let triggerEl = document.getElementById(
|
||||||
new bootstrap.Tab(triggerEl).show();
|
this.children["0"].$data.labelID
|
||||||
|
);
|
||||||
|
new b.Tab(triggerEl).show();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -8,14 +8,15 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bootstrap": "^5.0.13",
|
"@types/bootstrap": "^5.0.13",
|
||||||
"@types/jquery": "^3.5.5",
|
"@types/jquery": "^3.5.5",
|
||||||
"@vuepress/plugin-back-to-top": "^2.0.0-beta.11",
|
"@vuepress/plugin-back-to-top": "^2.0.0-beta.12",
|
||||||
"@vuepress/plugin-search": "^2.0.0-beta.11",
|
"@vuepress/plugin-search": "^2.0.0-beta.12",
|
||||||
"postcss-loader": "^5.2.0",
|
"postcss-loader": "^5.2.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"sass": "^1.32.12",
|
"sass": "^1.32.12",
|
||||||
"sass-loader": "^11.0.1",
|
"sass-loader": "^11.0.1",
|
||||||
"vue-property-decorator": "^9.1.2",
|
"vue-property-decorator": "^9.1.2",
|
||||||
"vuepress": "^2.0.0-beta.11"
|
"vuepress": "^2.0.0-beta.12",
|
||||||
|
"vuepress-vite": "^2.0.0-beta.12"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"docs:dev": "vuepress dev docs",
|
"docs:dev": "vuepress dev docs",
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@popperjs/core": "^2.9.1",
|
"@popperjs/core": "^2.9.1",
|
||||||
|
"@vuepress/plugin-debug": "^2.0.0-beta.12",
|
||||||
"bootstrap": "^5.0.0-beta3",
|
"bootstrap": "^5.0.0-beta3",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"markdown-it-footnote": "^3.0.2",
|
"markdown-it-footnote": "^3.0.2",
|
||||||
|
|
Loading…
Reference in New Issue