vuepress打包报错【已解决】

简介: vuepress打包报错【已解决】

异常信息

PS E:\myworkpace\blog\JavaPub-Blog> yarn docs:build
yarn run v1.22.18
$ vuepress build docs
info Initializing VuePress and preparing data...
⠦ Compiling with viteUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
⠼ Compiling with viteUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
⠏ Compiling with vite
(!) Some chunks are larger than 500 KiB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✔ Compiling with vite - done
✖ Rendering pages - failed
TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:2755:15)
    at createComponentInstance (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:5644:23)
    at renderComponentVNode (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:194:22)
    at Object.ssrRenderComponent (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:626:12)
    at _sfc_ssrRender$X (E:\myworkpace\blog\JavaPub-Blog\docs\.vuepress\dist\.server\app.js:10145:24)
    at renderComponentSubTree (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:266:13)
    at renderComponentVNode (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:211:16)
    at renderVNode (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:307:22)
    at renderComponentSubTree (E:\myworkpace\blog\JavaPub-Blog\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:272:13)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

原因

vite打包报错:块的大小超过限制,Some chunks are larger than 500kb after minification

解决

vuepress2.x 是基于 Vue3.x开发,相比 Vuepress1.x 对 html 的使用更严格。如下图所示的非标准 html 标签在开发阶段没问题,编译却无法通过。

<font 标签已弃用

目录
相关文章
|
1月前
vue3打包war压缩包配置
vue3打包war压缩包配置
34 0
|
11月前
|
JavaScript 前端开发
如何将你的项目上传到 npm
如何将你的项目上传到 npm
422 0
|
1月前
|
前端开发 API
SASS的导入文件详细教程
SASS的导入文件详细教程
42 0
|
7月前
|
JavaScript
Vue项目dist文件夹不能上传至github问题
Vue项目dist文件夹不能上传至github问题
81 0
|
11月前
|
Linux 编译器 C语言
Buildozer打包
Linux环境下将Python代码打包为app
324 0
|
11月前
|
JavaScript
vue之如何打包上传服务器
vue之如何打包上传服务器
|
存储 缓存 编解码
pnpm 中的 .npmrc 文件配置
.npmrc 文件是一个使用 .ini 文件格式书写的配置文件。本文介绍pnpm 中的 .npmrc 文件配置方法。
2080 0
pnpm 中的 .npmrc 文件配置
|
数据安全/隐私保护 开发者 Ruby
Fastlane 自动打包
Fastlane 自动打包
Fastlane 自动打包
在vuecli3怎么提升构建打包速度?
在vuecli3怎么提升构建打包速度?
264 0
|
前端开发
gitbook 插件:视频
gitbook 插件:视频
gitbook 插件:视频