fes.js/assets/directory-structure.html.c7e6fd2d.js

71 lines
16 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 e,r as t,o,c as p,b as n,d as s,a as c,w as i,f as u}from"./app.bd9c95b7.js";const l={},r=n("h1",{id:"目录结构",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#目录结构","aria-hidden":"true"},"#"),s(" 目录结构")],-1),d=n("code",null,"约定优于配置",-1),k=u(`<div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>fes-template
├── package.json
├── tsconfig.json
├── mock.js
├── .fes.js
├── .env
├── index.html
├── dist
├── public
│ └── logo.png
└── src
├── .fes
└── pages
│ └── index.vue
└── app.js
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="package-json" tabindex="-1"><a class="header-anchor" href="#package-json" aria-hidden="true">#</a> package.json</h3><div class="language-json line-numbers-mode" data-ext="json"><pre class="language-json"><code><span class="token punctuation">{</span>
<span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;@fesjs/template&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;description&quot;</span><span class="token operator">:</span> <span class="token string">&quot;fes项目模版&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;scripts&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;build&quot;</span><span class="token operator">:</span> <span class="token string">&quot;fes build&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;prod&quot;</span><span class="token operator">:</span> <span class="token string">&quot;FES_ENV=prod fes build&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;analyze&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ANALYZE=1 fes build&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;dev&quot;</span><span class="token operator">:</span> <span class="token string">&quot;fes dev&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;test&quot;</span><span class="token operator">:</span> <span class="token string">&quot;fes test&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;keywords&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">&quot;管理端&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;fes&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;fast&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;easy&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;strong&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token property">&quot;files&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">&quot;.eslintrc.js&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;.gitignore&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;.fes.js&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;.fes.prod.js&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;mock.js&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;package.json&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;README.md&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;tsconfig.json&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;/src&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;/config&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token property">&quot;repository&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;git&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;url&quot;</span><span class="token operator">:</span> <span class="token string">&quot;git+https://github.com/WeBankFinTech/fes.js.git&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;directory&quot;</span><span class="token operator">:</span> <span class="token string">&quot;packages/fes-template&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;author&quot;</span><span class="token operator">:</span> <span class="token string">&quot;harrywan&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;license&quot;</span><span class="token operator">:</span> <span class="token string">&quot;MIT&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;bugs&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;url&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://github.com/WeBankFinTech/fes.js/issues&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;homepage&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://github.com/WeBankFinTech/fes.js#readme&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;publishConfig&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;access&quot;</span><span class="token operator">:</span> <span class="token string">&quot;public&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;devDependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;@webank/eslint-config-webank&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1.2.1&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;dependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">&quot;@fesjs/fes&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/builder-webpack&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-access&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-layout&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^5.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-model&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-enums&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-jest&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-vuex&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-request&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-qiankun&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-sass&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-monaco-editor&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/plugin-windicss&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.0.0&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;@fesjs/fes-design&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^0.7.23&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;vue&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^3.2.47&quot;</span><span class="token punctuation">,</span>
<span class="token property">&quot;vuex&quot;</span><span class="token operator">:</span> <span class="token string">&quot;^4.0.0&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token property">&quot;private&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span>
<span class="token punctuation">}</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>其中<code>@fesjs/fes</code>是 Fes.js 核心依赖,另外以 <code>@fesjs/preset-</code>、<code>@fesjs/plugin-</code>、<code>@webank/fes-preset-</code>、<code>@webank/fes-plugin-</code>、<code>fes-preset-</code> 和 <code>fes-plugin-</code> 开头的依赖会被自动注册为插件或插件集。<code>@fesjs/builder-</code> 开头的会被注册为构建器。</p><h3 id="tsconfig-json" tabindex="-1"><a class="header-anchor" href="#tsconfig-json" aria-hidden="true">#</a> tsconfig.json</h3><p>解决 <code>@fesjs/fes</code> 和使用 <code>@</code> 的 API 提示</p><h3 id="fes-js" tabindex="-1"><a class="header-anchor" href="#fes-js" aria-hidden="true">#</a> .fes.js</h3><p>配置文件,包含 Fes.js 内置功能和安装的其他插件配置。</p><h3 id="mock-js" tabindex="-1"><a class="header-anchor" href="#mock-js" aria-hidden="true">#</a> mock.js</h3><p><code>mock</code> 数据的配置文件。</p><h3 id="env" tabindex="-1"><a class="header-anchor" href="#env" aria-hidden="true">#</a> .env</h3><p>定义环境变量。</p><p>比如 <code>.env</code> 文件内容如下:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>PORT=8888
FES_ENV=prod
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>等同于 node 端运行时,设置如下:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>p<wbr>rocess.env.PORT = &#39;8888&#39;;
p<wbr>rocess.env.FES_ENV = &#39;prod&#39;;
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="dist-目录" tabindex="-1"><a class="header-anchor" href="#dist-目录" aria-hidden="true">#</a> dist 目录</h3><p>执行 <code>fes build</code> 后,产物默认会存放在这里。</p><h3 id="public-目录" tabindex="-1"><a class="header-anchor" href="#public-目录" aria-hidden="true">#</a> public 目录</h3><p>此目录下所有文件为静态资源,会被复制到输出路径。</p><h3 id="index-html" tabindex="-1"><a class="header-anchor" href="#index-html" aria-hidden="true">#</a> index.html</h3><p>默认的 <code>html</code> 模板文件,如果删除此 <code>html</code> 则会使用内置的 <code>html</code> 模板文件。</p><h3 id="src-目录" tabindex="-1"><a class="header-anchor" href="#src-目录" aria-hidden="true">#</a> src 目录</h3><h3 id="fes-目录" tabindex="-1"><a class="header-anchor" href="#fes-目录" aria-hidden="true">#</a> .fes 目录</h3><p>临时文件目录,比如入口文件、路由等,都会被临时生成到这里。</p><div class="custom-container warning"><p class="custom-container-title">注意</p><p>不要提交 <code>.fes</code> 目录到 <code>git</code> 仓库,他们会在 <code>fes dev</code> 和 <code>fes build</code> 时被删除并重新生成。</p></div><h3 id="pages-目录" tabindex="-1"><a class="header-anchor" href="#pages-目录" aria-hidden="true">#</a> pages 目录</h3><p>所有路由组件文件存放在这里。</p><h3 id="app-js" tabindex="-1"><a class="header-anchor" href="#app-js" aria-hidden="true">#</a> app.js</h3><p>运行时配置文件,可以在这里扩展运行时的能力,比如修改路由等。</p>`,30);function q(v,m){const a=t("RouterLink");return o(),p("div",null,[r,n("p",null,[s("在"),c(a,{to:"/guide/getting-started.html"},{default:i(()=>[s("快速上手")]),_:1}),s("中大家对框架应该有初步的印象接下来我们了解下目录结构。Fes.js 遵循 "),d,s(" 的原则,一个基础的 Fes.js 项目大致是这样的:")]),k])}const g=e(l,[["render",q],["__file","directory-structure.html.vue"]]);export{g as default};