mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
71 lines
16 KiB
JavaScript
71 lines
16 KiB
JavaScript
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.0e52fd78.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">"name"</span><span class="token operator">:</span> <span class="token string">"@fesjs/template"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"version"</span><span class="token operator">:</span> <span class="token string">"2.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"description"</span><span class="token operator">:</span> <span class="token string">"fes项目模版"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"scripts"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"build"</span><span class="token operator">:</span> <span class="token string">"fes build"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"prod"</span><span class="token operator">:</span> <span class="token string">"FES_ENV=prod fes build"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"analyze"</span><span class="token operator">:</span> <span class="token string">"ANALYZE=1 fes build"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"dev"</span><span class="token operator">:</span> <span class="token string">"fes dev"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"test"</span><span class="token operator">:</span> <span class="token string">"fes test"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"keywords"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">"管理端"</span><span class="token punctuation">,</span> <span class="token string">"fes"</span><span class="token punctuation">,</span> <span class="token string">"fast"</span><span class="token punctuation">,</span> <span class="token string">"easy"</span><span class="token punctuation">,</span> <span class="token string">"strong"</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||
<span class="token property">"files"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">".eslintrc.js"</span><span class="token punctuation">,</span> <span class="token string">".gitignore"</span><span class="token punctuation">,</span> <span class="token string">".fes.js"</span><span class="token punctuation">,</span> <span class="token string">".fes.prod.js"</span><span class="token punctuation">,</span> <span class="token string">"mock.js"</span><span class="token punctuation">,</span> <span class="token string">"package.json"</span><span class="token punctuation">,</span> <span class="token string">"README.md"</span><span class="token punctuation">,</span> <span class="token string">"tsconfig.json"</span><span class="token punctuation">,</span> <span class="token string">"/src"</span><span class="token punctuation">,</span> <span class="token string">"/config"</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||
<span class="token property">"repository"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"git"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"url"</span><span class="token operator">:</span> <span class="token string">"git+https://github.com/WeBankFinTech/fes.js.git"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"directory"</span><span class="token operator">:</span> <span class="token string">"packages/fes-template"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"author"</span><span class="token operator">:</span> <span class="token string">"harrywan"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"license"</span><span class="token operator">:</span> <span class="token string">"MIT"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"bugs"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"url"</span><span class="token operator">:</span> <span class="token string">"https://github.com/WeBankFinTech/fes.js/issues"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"homepage"</span><span class="token operator">:</span> <span class="token string">"https://github.com/WeBankFinTech/fes.js#readme"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"publishConfig"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"access"</span><span class="token operator">:</span> <span class="token string">"public"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"devDependencies"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"@webank/eslint-config-webank"</span><span class="token operator">:</span> <span class="token string">"1.2.1"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"dependencies"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token property">"@fesjs/fes"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/builder-webpack"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-access"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-layout"</span><span class="token operator">:</span> <span class="token string">"^5.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-model"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-enums"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-jest"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-vuex"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-request"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-qiankun"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-sass"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-monaco-editor"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/plugin-windicss"</span><span class="token operator">:</span> <span class="token string">"^3.0.0"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"@fesjs/fes-design"</span><span class="token operator">:</span> <span class="token string">"^0.7.23"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"vue"</span><span class="token operator">:</span> <span class="token string">"^3.2.47"</span><span class="token punctuation">,</span>
|
||
<span class="token property">"vuex"</span><span class="token operator">:</span> <span class="token string">"^4.0.0"</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token property">"private"</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 = '8888';
|
||
p<wbr>rocess.env.FES_ENV = 'prod';
|
||
</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};
|