mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunkfes_js=self.webpackChunkfes_js||[]).push([[872],{7937:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-76cb52e8",path:"/reference/cli/",title:"命令行工具",lang:"zh-CN",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"create-fes-app",slug:"create-fes-app",children:[]},{level:2,title:"fes",slug:"fes",children:[{level:3,title:"fes dev",slug:"fes-dev",children:[]},{level:3,title:"fes build",slug:"fes-build",children:[]},{level:3,title:"fes help",slug:"fes-help",children:[]},{level:3,title:"fes info",slug:"fes-info",children:[]},{level:3,title:"fes webpack",slug:"fes-webpack",children:[]}]}],filePathRelative:"reference/cli/README.md",git:{updatedTime:1680249231e3,contributors:[{name:"wanchun",email:"445436867@qq.com",commits:1}]}}},6761:(e,n,s)=>{s.r(n),s.d(n,{default:()=>d});var a=s(6252);const l=(0,a.uE)('<h1 id="命令行工具" tabindex="-1"><a class="header-anchor" href="#命令行工具" aria-hidden="true">#</a> 命令行工具</h1><h2 id="create-fes-app" tabindex="-1"><a class="header-anchor" href="#create-fes-app" aria-hidden="true">#</a> create-fes-app</h2><p>通过 <code>create-fes-app</code> 命令创建项目模板,输入<code>create-fes-app -h</code>则可以看到如下信息:</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: create-fes-app <name>\n\nOptions:\n -v, --version Output the current version\n -h, --help Display help for command \n -f, --force Overwrite target directory if it exists\n -m, --merge Merge target directory if it exists\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>可以在本机安装后使用:</p>',5),r=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" global "),(0,a._)("span",{class:"token function"},"add"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),p=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 全局安装"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" i "),(0,a._)("span",{class:"token parameter variable"},"-g"),(0,a.Uk)(" @fesjs/create-fes-app\n\n"),(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\ncreate-fes-app fes-app\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br")])],-1),i=(0,a._)("p",null,[(0,a.Uk)("推荐使用 "),(0,a._)("code",null,"yarn create"),(0,a.Uk)(" 和 "),(0,a._)("code",null,"npx"),(0,a.Uk)(" 方式创建模板,一直使用最新的模板:")],-1),c=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" create @fesjs/fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"yarn"),(0,a.Uk)(" dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),t=(0,a._)("div",{class:"language-bash ext-sh line-numbers-mode"},[(0,a._)("pre",{class:"language-bash"},[(0,a._)("code",null,[(0,a._)("span",{class:"token comment"},"# 创建模板"),(0,a.Uk)("\nnpx @fesjs/create-fes-app myapp\n\n"),(0,a._)("span",{class:"token comment"},"# 安装依赖"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(),(0,a._)("span",{class:"token function"},"install"),(0,a.Uk)(" \n\n"),(0,a._)("span",{class:"token comment"},"# 运行"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token function"},"npm"),(0,a.Uk)(" run dev\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br")])],-1),b=(0,a.uE)('<h2 id="fes" tabindex="-1"><a class="header-anchor" href="#fes" aria-hidden="true">#</a> fes</h2><p>需要在项目根目录执行 <code>fes</code> 命令,输入<code>fes -h</code>则可以看到如下信息:</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: fes <command> [options]\n\n一个好用的前端应用解决方案\n\nOptions:\n -v, --vers output the current version\n -h, --help display help for command\n\nCommands:\n build build application for production\n dev [options] start a local http service for development\n help show command helps\n info print debugging information about your environment\n webpack [options] inspect webpack configurations\n\n Run fes <command> --help for detailed usage of given command.\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h3 id="fes-dev" tabindex="-1"><a class="header-anchor" href="#fes-dev" aria-hidden="true">#</a> fes dev</h3><p>启动本地开发服务器进行项目的开发调试。</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: fes dev [options]\n\nstart a local http service for development\n\nOptions:\n --port http service port, like 8080\n --https whether to turn on the https service\n -h, --help display help for command\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><p>比如:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>fes dev <span class="token parameter variable">--port</span><span class="token operator">=</span><span class="token number">8080</span>\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="fes-build" tabindex="-1"><a class="header-anchor" href="#fes-build" aria-hidden="true">#</a> fes build</h3><p>编译构建 web 产物。</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: fes build [options]\n\nbuild application for production\n\nOptions:\n -h, --help display help for command\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p>比如:</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>fes build\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="fes-help" tabindex="-1"><a class="header-anchor" href="#fes-help" aria-hidden="true">#</a> fes help</h3><p>打印帮助文档。 比如:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>fes <span class="token builtin class-name">help</span>\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="fes-info" tabindex="-1"><a class="header-anchor" href="#fes-info" aria-hidden="true">#</a> fes info</h3><p>打印当前项目的有用的环境信息,用来帮助定位问题。</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: fes info [options]\n\nprint debugging information about your environment\n\nOptions:\n -h, --help display help for command\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p>比如:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>fes info\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="fes-webpack" tabindex="-1"><a class="header-anchor" href="#fes-webpack" aria-hidden="true">#</a> fes webpack</h3><p>查看项目使用的 webpack 配置。</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Usage: fes webpack [options]\n\ninspect webpack configurations\n\nOptions:\n --rule <ruleName> inspect a specific module rule\n --plugin <pluginName> inspect a specific plugin\n --rules list all module rule names\n --plugins list all plugin names\n --verbose show full function definitions in output\n -h, --help display help for command\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>比如:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>fes webpack\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div>',26),u={},d=(0,s(3744).Z)(u,[["render",function(e,n){const s=(0,a.up)("CodeGroupItem"),u=(0,a.up)("CodeGroup");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[p])),_:1})])),_:1}),i,(0,a.Wm)(u,null,{default:(0,a.w5)((()=>[(0,a.Wm)(s,{title:"YARN",active:""},{default:(0,a.w5)((()=>[c])),_:1}),(0,a.Wm)(s,{title:"NPM"},{default:(0,a.w5)((()=>[t])),_:1})])),_:1}),b],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}}}]); |