mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
perf: add vite ssr no external
This commit is contained in:
parent
95f19a3999
commit
58b414c975
@ -2,6 +2,7 @@
|
||||
"name": "@vuepress-plume/plugin-copy-code",
|
||||
"type": "module",
|
||||
"version": "1.0.0-rc.58",
|
||||
"private": "true",
|
||||
"description": "The Plugin for VuePres 2 - copy code",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"license": "MIT",
|
||||
|
||||
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@ -396,9 +396,6 @@ importers:
|
||||
'@vuepress-plume/plugin-content-update':
|
||||
specifier: workspace:*
|
||||
version: link:../plugins/plugin-content-update
|
||||
'@vuepress-plume/plugin-copy-code':
|
||||
specifier: workspace:*
|
||||
version: link:../plugins/plugin-copy-code
|
||||
'@vuepress-plume/plugin-iconify':
|
||||
specifier: workspace:*
|
||||
version: link:../plugins/plugin-iconify
|
||||
@ -478,8 +475,8 @@ importers:
|
||||
specifier: 2.0.0-rc.12
|
||||
version: 2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))
|
||||
vuepress-plugin-md-enhance:
|
||||
specifier: ^2.0.0-rc.44
|
||||
version: 2.0.0-rc.44(chart.js@4.4.3)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.10)(markdown-it@14.1.0)(mermaid@10.9.1)(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)))
|
||||
specifier: ^2.0.0-rc.45
|
||||
version: 2.0.0-rc.45(chart.js@4.4.3)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.10)(markdown-it@14.1.0)(mermaid@10.9.1)(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)))
|
||||
vuepress-plugin-md-power:
|
||||
specifier: workspace:*
|
||||
version: link:../plugins/plugin-md-power
|
||||
@ -8844,8 +8841,8 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
vuepress-plugin-md-enhance@2.0.0-rc.44:
|
||||
resolution: {integrity: sha512-OdHUaohwn/Hac91h8lO13w5An0AJjZXpj9azT67RwMPubanjIUtFi/0Ch7gGVw8e2w2Uo/1lM146V7QARhbFbA==}
|
||||
vuepress-plugin-md-enhance@2.0.0-rc.45:
|
||||
resolution: {integrity: sha512-5Ygw/ZsEf9zQJ5louY2uwbLPxF6KY4SHGOaPgCIGfMygrqcElapXUP7+eodOnw0JwEKPQcZzdyWRUBHQxPwOSg==}
|
||||
engines: {node: '>=18.19.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'}
|
||||
peerDependencies:
|
||||
'@types/reveal.js': ^5.0.0
|
||||
@ -8896,8 +8893,8 @@ packages:
|
||||
sass-loader:
|
||||
optional: true
|
||||
|
||||
vuepress-shared@2.0.0-rc.44:
|
||||
resolution: {integrity: sha512-fFeG7mGlvbLaUgYu6dyBSheKfRVA7O/bZqIj4FordvfNsGFqyERXLWsUpU5YpVOUzvRdo8sfeaVXG78Qqa+ZQA==}
|
||||
vuepress-shared@2.0.0-rc.45:
|
||||
resolution: {integrity: sha512-YFoCmB1kPgcQO+gRg2K1rXFmyLvkn4Ak8i0jRmSdpo92muLInB/t6GFG7VCZ+xBM88eu2rQW53BvNmWZ246xiQ==}
|
||||
engines: {node: '>=18.19.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'}
|
||||
peerDependencies:
|
||||
vuepress: 2.0.0-rc.12
|
||||
@ -18586,7 +18583,7 @@ snapshots:
|
||||
optionalDependencies:
|
||||
typescript: 5.4.5
|
||||
|
||||
vuepress-plugin-md-enhance@2.0.0-rc.44(chart.js@4.4.3)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.10)(markdown-it@14.1.0)(mermaid@10.9.1)(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))):
|
||||
vuepress-plugin-md-enhance@2.0.0-rc.45(chart.js@4.4.3)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.10)(markdown-it@14.1.0)(mermaid@10.9.1)(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))):
|
||||
dependencies:
|
||||
'@mdit/plugin-alert': 0.12.0(markdown-it@14.1.0)
|
||||
'@mdit/plugin-align': 0.12.0(markdown-it@14.1.0)
|
||||
@ -18619,7 +18616,7 @@ snapshots:
|
||||
js-yaml: 4.1.0
|
||||
vue: 3.4.27(typescript@5.4.5)
|
||||
vuepress: 2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))
|
||||
vuepress-shared: 2.0.0-rc.44(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)))
|
||||
vuepress-shared: 2.0.0-rc.45(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)))
|
||||
optionalDependencies:
|
||||
chart.js: 4.4.3
|
||||
echarts: 5.5.0
|
||||
@ -18631,7 +18628,7 @@ snapshots:
|
||||
- markdown-it
|
||||
- typescript
|
||||
|
||||
vuepress-shared@2.0.0-rc.44(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))):
|
||||
vuepress-shared@2.0.0-rc.45(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))):
|
||||
dependencies:
|
||||
'@vuepress/helper': 2.0.0-rc.31(typescript@5.4.5)(vuepress@2.0.0-rc.12(@vuepress/bundler-vite@2.0.0-rc.12(@types/node@20.12.10)(sass@1.77.2)(typescript@5.4.5))(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)))
|
||||
'@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5))
|
||||
|
||||
@ -71,7 +71,6 @@
|
||||
"@vuepress-plume/plugin-baidu-tongji": "workspace:*",
|
||||
"@vuepress-plume/plugin-blog-data": "workspace:*",
|
||||
"@vuepress-plume/plugin-content-update": "workspace:*",
|
||||
"@vuepress-plume/plugin-copy-code": "workspace:*",
|
||||
"@vuepress-plume/plugin-iconify": "workspace:*",
|
||||
"@vuepress-plume/plugin-notes-data": "workspace:*",
|
||||
"@vuepress-plume/plugin-search": "workspace:*",
|
||||
@ -97,7 +96,7 @@
|
||||
"nanoid": "^5.0.7",
|
||||
"vue": "^3.4.27",
|
||||
"vue-router": "^4.3.2",
|
||||
"vuepress-plugin-md-enhance": "^2.0.0-rc.44",
|
||||
"vuepress-plugin-md-enhance": "^2.0.0-rc.45",
|
||||
"vuepress-plugin-md-power": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Page, Theme } from 'vuepress/core'
|
||||
import { templateRenderer } from 'vuepress/utils'
|
||||
import { isPlainObject } from '@vuepress/helper'
|
||||
import { addViteConfig, addViteOptimizeDepsInclude, addViteSsrNoExternal, isPlainObject } from '@vuepress/helper'
|
||||
import type { PlumeThemeOptions, PlumeThemePageData } from '../shared/index.js'
|
||||
import { getPlugins } from './plugins/index.js'
|
||||
import { extendsPageData, setupPage } from './setupPages.js'
|
||||
@ -50,6 +50,19 @@ export function plumeTheme({
|
||||
resolvePageHead(page, localeOptions)
|
||||
},
|
||||
|
||||
extendsBundlerOptions(bundlerOptions, app) {
|
||||
addViteConfig(bundlerOptions, app, {
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1024,
|
||||
},
|
||||
})
|
||||
addViteOptimizeDepsInclude(bundlerOptions, app, '@vueuse/core', true)
|
||||
addViteSsrNoExternal(bundlerOptions, app, [
|
||||
'@vuepress/helper',
|
||||
'@vuepress/plugin-reading-time',
|
||||
])
|
||||
},
|
||||
|
||||
templateBuildRenderer(template, context) {
|
||||
template = template
|
||||
.replace('{{ themeVersion }}', pkg.version || '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user