fes.js/assets/upgrade3.html.64210bf0.js

2 lines
3.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as i,r as l,o as c,c as s,b as t,d as e,a as n,w as a,f as d}from"./app.0e52fd78.js";const h={},u=t("h1",{id:"从-2-0-x-迁移到-3-0-x",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#从-2-0-x-迁移到-3-0-x","aria-hidden":"true"},"#"),e(" 从 2.0.x 迁移到 3.0.x")],-1),_=t("h2",{id:"版本-3-0-x-的-break",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#版本-3-0-x-的-break","aria-hidden":"true"},"#"),e(" 版本 3.0.x 的 break")],-1),p={href:"https://github.com/webpack/webpack-dev-server",target:"_blank",rel:"noopener noreferrer"},b=t("code",null,"v3.x",-1),f=t("code",null,"v4.x",-1),k={href:"https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md",target:"_blank",rel:"noopener noreferrer"},m=t("h2",{id:"继续使用-webpack",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#继续使用-webpack","aria-hidden":"true"},"#"),e(" 继续使用 Webpack")],-1),x=t("li",null,[e("添加 Webpack 构建依赖包: "),t("code",null,"npm i @fesjs/builder-webpack -D"),e("。")],-1),g=t("code",null,"public/index.html",-1),v={href:"https://github.com/jantimon/html-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},w=t("h2",{id:"换成-vite",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#换成-vite","aria-hidden":"true"},"#"),e(" 换成 Vite")],-1),j=t("li",null,[e("安装依赖包 "),t("code",null,"npm i @fesjs/builder-vite"),e("。")],-1),V=t("li",null,[e("将 Webpack 相关的配置换成 Vite具体可查看"),t("a",{href:"../reference/config"},"配置"),e("。")],-1),L=t("code",null,"public/index.html",-1),q={href:"https://github.com/jantimon/html-webpack-plugin",target:"_blank",rel:"noopener noreferrer"},N={href:"https://github.com/vbenjs/vite-plugin-html",target:"_blank",rel:"noopener noreferrer"},W=t("li",null,[e("将 "),t("code",null,"require"),e(" 等 Vite 不支持的代码,改写成 Vite 支持的方式。")],-1),B=d('<h2 id="插件" tabindex="-1"><a class="header-anchor" href="#插件" aria-hidden="true">#</a> 插件</h2><p>插件都需要升级到 <code>3.0.x</code> 版本,新版添加了兼容<code>builder</code>的逻辑,但是提供的接口和配置没有变化,只需要升级版本即可使用。</p><ul><li><a href="../reference/plugins/layout">@fesjs/plugin-layout</a> 需要升级到<code>5.0.x</code>版本。</li><li><a href="../reference/plugins/locale">@fesjs/plugin-locale</a> 需要升级到<code>4.0.x</code>版本。</li><li><a href="../reference/plugins/qiankun">@fesjs/plugin-qiankun</a> 由于<code>qiankun</code>技术限制,子应用目前还只能使用 Webpack 构建。</li></ul>',3);function E(y,C){const o=l("RouterLink"),r=l("ExternalLinkIcon");return c(),s("div",null,[u,_,t("ol",null,[t("li",null,[e("编译时的 "),n(o,{to:"/reference/config/#base"},{default:a(()=>[e("base")]),_:1}),e(" 配置,移到了 "),n(o,{to:"/reference/config/#router"},{default:a(()=>[e("router.base")]),_:1}),e(" 下。")]),t("li",null,[t("a",p,[e("webpack-dev-server"),n(r)]),e(" 从 "),b,e(" 升级到了 "),f,e(",如果遇到配置不兼容,可以查看"),t("a",k,[e("webpack-dev-server 3.x 升级 4.x"),n(r)]),e("。")])]),m,t("ol",null,[x,t("li",null,[e("如果有,将 "),g,e(" 文件挪到项目根目录,移除 "),t("a",v,[e("html-webpack-plugin"),n(r)]),e(" 相关配置,具体模版变量使用请查看"),n(o,{to:"/guide/template.html"},{default:a(()=>[e("HTML 模版")]),_:1}),e("。")])]),w,t("ol",null,[j,V,t("li",null,[e("将 html 模版文件从 "),L,e(" 挪到项目根目录,如果有相应的 "),t("a",q,[e("html-webpack-plugin"),n(r)]),e(" 配置,需要改成 "),t("a",N,[e("vite-plugin-html"),n(r)]),e(" 的写法。")]),W]),B])}const R=i(h,[["render",E],["__file","upgrade3.html.vue"]]);export{R as default};