mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
148 lines
81 KiB
HTML
148 lines
81 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<meta name="generator" content="VuePress 2.0.0-beta.53">
|
||
<style>
|
||
:root {
|
||
--c-bg: #fff;
|
||
}
|
||
html.dark {
|
||
--c-bg: #22272e;
|
||
}
|
||
html, body {
|
||
background-color: var(--c-bg);
|
||
}
|
||
</style>
|
||
<script>
|
||
const userMode = localStorage.getItem('vuepress-color-scheme');
|
||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||
document.documentElement.classList.toggle('dark', true);
|
||
}
|
||
</script>
|
||
<link rel="manifest" href="/manifest.webmanifest"><link rel="icon" href="/logo.png"><title> | Fes.js</title><meta name="description" content="一个好用的前端应用解决方案">
|
||
<link rel="preload" href="/assets/style.03dc0593.css" as="style" /><link rel="stylesheet" href="/assets/style.03dc0593.css" />
|
||
<link rel="modulepreload" href="/assets/app.bd9c95b7.js"><link rel="modulepreload" href="/assets/index.html.a2d6e9e6.js"><link rel="modulepreload" href="/assets/index.html.1e4e9bb2.js"><link rel="prefetch" href="/assets/index.html.c52ea2ee.js" as="script" /><link rel="prefetch" href="/assets/index.html.4ecf73ea.js" as="script" /><link rel="prefetch" href="/assets/builder.html.246dbbe3.js" as="script" /><link rel="prefetch" href="/assets/config.html.637a9806.js" as="script" /><link rel="prefetch" href="/assets/contributing.html.8f3528e9.js" as="script" /><link rel="prefetch" href="/assets/css.html.f4729d94.js" as="script" /><link rel="prefetch" href="/assets/directory-structure.html.c7ccc960.js" as="script" /><link rel="prefetch" href="/assets/env.html.2fbe8f51.js" as="script" /><link rel="prefetch" href="/assets/faq.html.7f01d8a8.js" as="script" /><link rel="prefetch" href="/assets/getting-started.html.f4fdc148.js" as="script" /><link rel="prefetch" href="/assets/image.html.f92a08c2.js" as="script" /><link rel="prefetch" href="/assets/mock.html.561d68eb.js" as="script" /><link rel="prefetch" href="/assets/plugin.html.a5e6ae94.js" as="script" /><link rel="prefetch" href="/assets/public.html.950ba2eb.js" as="script" /><link rel="prefetch" href="/assets/route.html.8edafb3a.js" as="script" /><link rel="prefetch" href="/assets/runtime-config.html.b70d36d5.js" as="script" /><link rel="prefetch" href="/assets/template.html.900fbffc.js" as="script" /><link rel="prefetch" href="/assets/upgrade3.html.9bc44b95.js" as="script" /><link rel="prefetch" href="/assets/api.html.dd7de804.js" as="script" /><link rel="prefetch" href="/assets/cli.html.eb7c8bac.js" as="script" /><link rel="prefetch" href="/assets/index.html.833852a3.js" as="script" /><link rel="prefetch" href="/assets/index.html.4f4b557d.js" as="script" /><link rel="prefetch" href="/assets/index.html.4b24c667.js" as="script" /><link rel="prefetch" href="/assets/index.html.b99c3eab.js" as="script" /><link rel="prefetch" href="/assets/api.html.ad50f750.js" as="script" /><link rel="prefetch" href="/assets/access.html.ccef700f.js" as="script" /><link rel="prefetch" href="/assets/editor.html.45b1bf75.js" as="script" /><link rel="prefetch" href="/assets/enums.html.9eba9e94.js" as="script" /><link rel="prefetch" href="/assets/icon.html.1ef9becf.js" as="script" /><link rel="prefetch" href="/assets/jest.html.b6be70f6.js" as="script" /><link rel="prefetch" href="/assets/layout.html.737f0d05.js" as="script" /><link rel="prefetch" href="/assets/locale.html.a0788058.js" as="script" /><link rel="prefetch" href="/assets/login.html.3b52bc00.js" as="script" /><link rel="prefetch" href="/assets/model.html.a33983f1.js" as="script" /><link rel="prefetch" href="/assets/pinia.html.ca207361.js" as="script" /><link rel="prefetch" href="/assets/qiankun.html.fd060b60.js" as="script" /><link rel="prefetch" href="/assets/request.html.d16e6c85.js" as="script" /><link rel="prefetch" href="/assets/sass.html.be3aee7e.js" as="script" /><link rel="prefetch" href="/assets/swc.html.86a67f1f.js" as="script" /><link rel="prefetch" href="/assets/vuex.html.3e9bd488.js" as="script" /><link rel="prefetch" href="/assets/watermark.html.6ba7e245.js" as="script" /><link rel="prefetch" href="/assets/windicss.html.17a13504.js" as="script" /><link rel="prefetch" href="/assets/404.html.c3e557d0.js" as="script" /><link rel="prefetch" href="/assets/index.html.de0d80a1.js" as="script" /><link rel="prefetch" href="/assets/index.html.9f427ef5.js" as="script" /><link rel="prefetch" href="/assets/builder.html.5491993d.js" as="script" /><link rel="prefetch" href="/assets/config.html.bebaf600.js" as="script" /><link rel="prefetch" href="/assets/contributing.html.3aa886b1.js" as="script" /><link rel="prefetch" href="/assets/css.html.8c2b9f6e.js" as="script" /><link rel="prefetch" href="/assets/directory-structure.html.c7e6fd2d.js" as="script" /><link rel="prefetch" href="/assets/env.html.5728b740.js" as="script" /><link rel="prefetch" href="/assets/faq.html.d692a6e2.js" as="script" /><link rel="prefetch" href="/assets/getting-started.html.0eb9c5e2.js" as="script" /><link rel="prefetch" href="/assets/image.html.50bf0bdd.js" as="script" /><link rel="prefetch" href="/assets/mock.html.ab147021.js" as="script" /><link rel="prefetch" href="/assets/plugin.html.de4f8c7b.js" as="script" /><link rel="prefetch" href="/assets/public.html.d51b184d.js" as="script" /><link rel="prefetch" href="/assets/route.html.32be9bfc.js" as="script" /><link rel="prefetch" href="/assets/runtime-config.html.90acb818.js" as="script" /><link rel="prefetch" href="/assets/template.html.8e33412a.js" as="script" /><link rel="prefetch" href="/assets/upgrade3.html.c353af42.js" as="script" /><link rel="prefetch" href="/assets/api.html.87969763.js" as="script" /><link rel="prefetch" href="/assets/cli.html.af8c16d8.js" as="script" /><link rel="prefetch" href="/assets/index.html.9bf5bab1.js" as="script" /><link rel="prefetch" href="/assets/index.html.cbd2c491.js" as="script" /><link rel="prefetch" href="/assets/index.html.2877eae5.js" as="script" /><link rel="prefetch" href="/assets/index.html.d2f518d0.js" as="script" /><link rel="prefetch" href="/assets/api.html.06ea97fd.js" as="script" /><link rel="prefetch" href="/assets/access.html.1a82486a.js" as="script" /><link rel="prefetch" href="/assets/editor.html.0d361fe8.js" as="script" /><link rel="prefetch" href="/assets/enums.html.2b56cb9b.js" as="script" /><link rel="prefetch" href="/assets/icon.html.09e6d802.js" as="script" /><link rel="prefetch" href="/assets/jest.html.da327ef6.js" as="script" /><link rel="prefetch" href="/assets/layout.html.18970df4.js" as="script" /><link rel="prefetch" href="/assets/locale.html.669c5454.js" as="script" /><link rel="prefetch" href="/assets/login.html.5cb3e152.js" as="script" /><link rel="prefetch" href="/assets/model.html.17d86d37.js" as="script" /><link rel="prefetch" href="/assets/pinia.html.eb251b6e.js" as="script" /><link rel="prefetch" href="/assets/qiankun.html.03151319.js" as="script" /><link rel="prefetch" href="/assets/request.html.08c691d1.js" as="script" /><link rel="prefetch" href="/assets/sass.html.9236bc5e.js" as="script" /><link rel="prefetch" href="/assets/swc.html.1459de3d.js" as="script" /><link rel="prefetch" href="/assets/vuex.html.1794fc22.js" as="script" /><link rel="prefetch" href="/assets/watermark.html.e99470a0.js" as="script" /><link rel="prefetch" href="/assets/windicss.html.afe09b0e.js" as="script" /><link rel="prefetch" href="/assets/404.html.b697c9e3.js" as="script" /><link rel="prefetch" href="/assets/index.0b6f9a66.js" as="script" />
|
||
</head>
|
||
<body>
|
||
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/" class=""><img class="logo" src="/logo.png" alt="Fes.js"><span class="site-name can-hide">Fes.js</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a href="/guide/" class="" aria-label="指南"><!--[--><!--]--> 指南 <!--[--><!--]--></a></div><div class="navbar-item"><a aria-current="page" href="/reference/config/" class="router-link-active router-link-exact-active router-link-active" aria-label="编译时配置"><!--[--><!--]--> 编译时配置 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/api/" class="" aria-label="API"><!--[--><!--]--> API <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/plugin/" class="" aria-label="插件"><!--[--><!--]--> 插件 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/cli/" class="" aria-label="CLI"><!--[--><!--]--> CLI <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="v3.0.1-0"><span class="title">v3.0.1-0</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="v3.0.1-0"><span class="title">v3.0.1-0</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://fesjs.mumblefe.cn/2.0" rel="noopener noreferrer" target="_blank" aria-label="v2.0"><!--[--><!--]--> v2.0 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://fesjs.mumblefe.cn/1.0" rel="noopener noreferrer" target="_blank" aria-label="v1.0"><!--[--><!--]--> v1.0 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="了解更多"><span class="title">了解更多</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="了解更多"><span class="title">了解更多</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://github.com/WeBankFinTech/fes.js/blob/next/CHANGELOG.md" rel="noopener noreferrer" target="_blank" aria-label="更新日志"><!--[--><!--]--> 更新日志 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="http://fes-design.mumblefe.cn/" rel="noopener noreferrer" target="_blank" aria-label="fes-design"><!--[--><!--]--> fes-design <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/WeBankFinTech/fes.js" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="toggle color mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><div id="docsearch-container"></div></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a href="/guide/" class="" aria-label="指南"><!--[--><!--]--> 指南 <!--[--><!--]--></a></div><div class="navbar-item"><a aria-current="page" href="/reference/config/" class="router-link-active router-link-exact-active router-link-active" aria-label="编译时配置"><!--[--><!--]--> 编译时配置 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/api/" class="" aria-label="API"><!--[--><!--]--> API <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/plugin/" class="" aria-label="插件"><!--[--><!--]--> 插件 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/reference/cli/" class="" aria-label="CLI"><!--[--><!--]--> CLI <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="v3.0.1-0"><span class="title">v3.0.1-0</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="v3.0.1-0"><span class="title">v3.0.1-0</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://fesjs.mumblefe.cn/2.0" rel="noopener noreferrer" target="_blank" aria-label="v2.0"><!--[--><!--]--> v2.0 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://fesjs.mumblefe.cn/1.0" rel="noopener noreferrer" target="_blank" aria-label="v1.0"><!--[--><!--]--> v1.0 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="了解更多"><span class="title">了解更多</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="了解更多"><span class="title">了解更多</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://github.com/WeBankFinTech/fes.js/blob/next/CHANGELOG.md" rel="noopener noreferrer" target="_blank" aria-label="更新日志"><!--[--><!--]--> 更新日志 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="http://fes-design.mumblefe.cn/" rel="noopener noreferrer" target="_blank" aria-label="fes-design"><!--[--><!--]--> fes-design <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/WeBankFinTech/fes.js" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><p tabindex="0" class="sidebar-item sidebar-heading"> <!----></p><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/reference/config/#配置文件" class="router-link-active router-link-exact-active sidebar-item" aria-label="配置文件"><!--[--><!--]--> 配置文件 <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/reference/config/#配置文件解析" class="router-link-active router-link-exact-active sidebar-item" aria-label="配置文件解析"><!--[--><!--]--> 配置文件解析 <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#配置智能提示" class="router-link-active router-link-exact-active sidebar-item" aria-label="配置智能提示"><!--[--><!--]--> 配置智能提示 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a aria-current="page" href="/reference/config/#共享配置" class="router-link-active router-link-exact-active sidebar-item" aria-label="共享配置"><!--[--><!--]--> 共享配置 <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/reference/config/#alias" class="router-link-active router-link-exact-active sidebar-item" aria-label="alias"><!--[--><!--]--> alias <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#autoprefixer" class="router-link-active router-link-exact-active sidebar-item" aria-label="autoprefixer"><!--[--><!--]--> autoprefixer <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#base" class="router-link-active router-link-exact-active sidebar-item" aria-label="base"><!--[--><!--]--> base <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#define" class="router-link-active router-link-exact-active sidebar-item" aria-label="define"><!--[--><!--]--> define <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#dynamicimport" class="router-link-active router-link-exact-active sidebar-item" aria-label="dynamicImport"><!--[--><!--]--> dynamicImport <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#inlinelimit" class="router-link-active router-link-exact-active sidebar-item" aria-label="inlineLimit"><!--[--><!--]--> inlineLimit <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#mock" class="router-link-active router-link-exact-active sidebar-item" aria-label="mock"><!--[--><!--]--> mock <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#mountelementid" class="router-link-active router-link-exact-active sidebar-item" aria-label="mountElementId"><!--[--><!--]--> mountElementId <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#outputpath" class="router-link-active router-link-exact-active sidebar-item" aria-label="outputPath"><!--[--><!--]--> outputPath <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#plugins" class="router-link-active router-link-exact-active sidebar-item" aria-label="plugins"><!--[--><!--]--> plugins <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#proxy" class="router-link-active router-link-exact-active sidebar-item" aria-label="proxy"><!--[--><!--]--> proxy <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#publicpath" class="router-link-active router-link-exact-active sidebar-item" aria-label="publicPath"><!--[--><!--]--> publicPath <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#router" class="router-link-active router-link-exact-active sidebar-item" aria-label="router"><!--[--><!--]--> router <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#singular" class="router-link-active router-link-exact-active sidebar-item" aria-label="singular"><!--[--><!--]--> singular <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#targets" class="router-link-active router-link-exact-active sidebar-item" aria-label="targets"><!--[--><!--]--> targets <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#terseroptions" class="router-link-active router-link-exact-active sidebar-item" aria-label="terserOptions"><!--[--><!--]--> terserOptions <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#title" class="router-link-active router-link-exact-active sidebar-item" aria-label="title"><!--[--><!--]--> title <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a aria-current="page" href="/reference/config/#webpack-专属配置" class="router-link-active router-link-exact-active sidebar-item" aria-label="webpack 专属配置"><!--[--><!--]--> webpack 专属配置 <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/reference/config/#analyze" class="router-link-active router-link-exact-active sidebar-item" aria-label="analyze"><!--[--><!--]--> analyze <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#chainwebpack" class="router-link-active router-link-exact-active sidebar-item" aria-label="chainWebpack"><!--[--><!--]--> chainWebpack <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#cssloader" class="router-link-active router-link-exact-active sidebar-item" aria-label="cssLoader"><!--[--><!--]--> cssLoader <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#copy" class="router-link-active router-link-exact-active sidebar-item" aria-label="copy"><!--[--><!--]--> copy <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#devserver" class="router-link-active router-link-exact-active sidebar-item" aria-label="devServer"><!--[--><!--]--> devServer <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#devtool" class="router-link-active router-link-exact-active sidebar-item" aria-label="devtool"><!--[--><!--]--> devtool <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#exportstatic" class="router-link-active router-link-exact-active sidebar-item" aria-label="exportStatic"><!--[--><!--]--> exportStatic <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#externals" class="router-link-active router-link-exact-active sidebar-item" aria-label="externals"><!--[--><!--]--> externals <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#extrababelplugins" class="router-link-active router-link-exact-active sidebar-item" aria-label="extraBabelPlugins"><!--[--><!--]--> extraBabelPlugins <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#extrababelpresets" class="router-link-active router-link-exact-active sidebar-item" aria-label="extraBabelPresets"><!--[--><!--]--> extraBabelPresets <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#extrapostcssplugins" class="router-link-active router-link-exact-active sidebar-item" aria-label="extraPostCSSPlugins"><!--[--><!--]--> extraPostCSSPlugins <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#html" class="router-link-active router-link-exact-active sidebar-item" aria-label="html"><!--[--><!--]--> html <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#lessloader" class="router-link-active router-link-exact-active sidebar-item" aria-label="lessLoader"><!--[--><!--]--> lessLoader <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#nodemodulestransform" class="router-link-active router-link-exact-active sidebar-item" aria-label="nodeModulesTransform"><!--[--><!--]--> nodeModulesTransform <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#postcssloader" class="router-link-active router-link-exact-active sidebar-item" aria-label="postcssLoader"><!--[--><!--]--> postcssLoader <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#vueloader" class="router-link-active router-link-exact-active sidebar-item" aria-label="vueLoader"><!--[--><!--]--> vueLoader <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a aria-current="page" href="/reference/config/#vite-专属配置" class="router-link-active router-link-exact-active sidebar-item" aria-label="Vite 专属配置"><!--[--><!--]--> Vite 专属配置 <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/reference/config/#viteoption" class="router-link-active router-link-exact-active sidebar-item" aria-label="viteOption"><!--[--><!--]--> viteOption <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#vitevueplugin" class="router-link-active router-link-exact-active sidebar-item" aria-label="viteVuePlugin"><!--[--><!--]--> viteVuePlugin <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#vitevuejsx" class="router-link-active router-link-exact-active sidebar-item" aria-label="viteVueJsx"><!--[--><!--]--> viteVueJsx <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#vitelegacy" class="router-link-active router-link-exact-active sidebar-item" aria-label="viteLegacy"><!--[--><!--]--> viteLegacy <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/reference/config/#vitehtml" class="router-link-active router-link-exact-active sidebar-item" aria-label="viteHtml"><!--[--><!--]--> viteHtml <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a aria-current="page" href="/reference/config/#更多配置项" class="router-link-active router-link-exact-active sidebar-item" aria-label="更多配置项"><!--[--><!--]--> 更多配置项 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><!--]--><div><h2 id="配置文件" tabindex="-1"><a class="header-anchor" href="#配置文件" aria-hidden="true">#</a> 配置文件</h2><p>Fes.js 内置了比较通用的构建方式,如果没有个性化需求,不需要修改构建相关的配置。</p><h3 id="配置文件解析" tabindex="-1"><a class="header-anchor" href="#配置文件解析" aria-hidden="true">#</a> 配置文件解析</h3><p>Fes.js 会自动解析项目根目录下的 <code>.fes.js</code> 文件。</p><p>最基础的配置文件是这样的:</p><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token comment">// .fes.js</span>
|
||
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span><span class="token punctuation">}</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></div><p>可以通过环境变量 <code>FES_ENV</code> 进行环境差异化配置,当我们运行 <code>FES_ENV=prod fes dev</code> 时,Fes.js 会找到 <code>.fes.js</code> 和 <code>.fes.prod.js</code>(可选) 的配置文件进行 <code>deepmerge</code>。</p><h3 id="配置智能提示" tabindex="-1"><a class="header-anchor" href="#配置智能提示" aria-hidden="true">#</a> 配置智能提示</h3><p>可以通过 <code>defineBuildConfig</code> 工具函数获取类型提示:</p><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">import</span> <span class="token punctuation">{</span> defineBuildConfig <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@fesjs/fes'</span><span class="token punctuation">;</span>
|
||
|
||
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token function">defineBuildConfig</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</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></div><h2 id="共享配置" tabindex="-1"><a class="header-anchor" href="#共享配置" aria-hidden="true">#</a> 共享配置</h2><h3 id="alias" tabindex="-1"><a class="header-anchor" href="#alias" aria-hidden="true">#</a> alias</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>配置别名,对引用路径进行映射。</p></li><li><p>示例:</p></li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">alias</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">main</span><span class="token operator">:</span> <span class="token string">'src/assets/styles/main'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><p>然后 <code>import('main')</code>,实际上是 <code>import('src/assets/styles/main')</code>。</p><h3 id="autoprefixer" tabindex="-1"><a class="header-anchor" href="#autoprefixer" aria-hidden="true">#</a> autoprefixer</h3><ul><li>类型: <code>object</code></li><li>默认值:</li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token punctuation">{</span>
|
||
<span class="token literal-property property">flexbox</span><span class="token operator">:</span> <span class="token string">'no-2009'</span><span class="token punctuation">;</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></div><ul><li><p>详情:</p><p><a href="https://github.com/postcss/autoprefixer#options" target="_blank" rel="noopener noreferrer">postcss autoprefixer 插件<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 配置。</p></li></ul><h3 id="base" tabindex="-1"><a class="header-anchor" href="#base" aria-hidden="true">#</a> base</h3><ul><li><p>类型: <code>string</code></p></li><li><p>默认值: <code>''</code></p></li><li><p>详情:</p><p>设置路由前缀,通常用于部署到非根目录。比如你有路由 <code>/pageA</code>、<code>/pageB</code>,然后设置了 <code>base</code> 为 <code>/manage/</code>,那么就可以通过 <code>/manage/pageA</code>、<code>/manage/pageB</code> 访问到它们。</p></li></ul><div class="custom-container warning"><p class="custom-container-title">2.1.x 已废弃</p><p>2.1.x 版本请使用 router.base 代替</p></div><h3 id="define" tabindex="-1"><a class="header-anchor" href="#define" aria-hidden="true">#</a> define</h3><ul><li>类型: <code>object</code></li><li>默认值: <code>{}</code></li><li>详情: 用于提供给代码中可用的变量。</li><li>示例:</li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">define</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">__DEV__</span><span class="token operator">:</span> <span class="token string">'development'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><p>然后你代码里写 <code>console.log(__DEV__)</code>,会被编译成 <code>console.log('development')</code>。</p><h3 id="dynamicimport" tabindex="-1"><a class="header-anchor" href="#dynamicimport" aria-hidden="true">#</a> dynamicImport</h3><ul><li><p>类型: <code>boolean</code></p></li><li><p>默认值: false</p></li><li><p>详情:</p><p>路由是否按需加载</p></li></ul><h3 id="inlinelimit" tabindex="-1"><a class="header-anchor" href="#inlinelimit" aria-hidden="true">#</a> inlineLimit</h3><ul><li><p>类型: <code>number</code></p></li><li><p>默认值: <code>8192</code>(8k)</p></li><li><p>详情:</p><p>配置图片文件是否走 base64 编译的阈值。默认是 <code>8192</code> 字节,小于它会被编译为 base64 编码,否则会生成单独的文件。</p></li></ul><h3 id="mock" tabindex="-1"><a class="header-anchor" href="#mock" aria-hidden="true">#</a> mock</h3><ul><li><p>类型: <code>object || boolean</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>配置 mock 属性。</p><ul><li>当 mock 为 <code>boolean</code> 类型时,<code>true</code> 表示打开 mock,<code>false</code> 表示关闭 mock。</li><li>当 mock 为 <code>object</code> 类型时,默认打开 mock。也可以通过子属性 <code>prefix</code> 添加过滤条件,满足条件的走 mock 文件。</li></ul></li><li><p>示例:</p></li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">mock</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">prefix</span><span class="token operator">:</span> <span class="token string">'/api/auth'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><p>然后所有以 <code>/api/users</code> 开始的请求,就能进入 mock.js 文件处理,<a href="../../guide/mock">mock.js 示例</a>。</p><h3 id="mountelementid" tabindex="-1"><a class="header-anchor" href="#mountelementid" aria-hidden="true">#</a> mountElementId</h3><ul><li><p>类型: <code>string</code></p></li><li><p>默认值: <code>app</code></p></li><li><p>详情:</p><p>指定渲染到的 HTML 元素 id。</p></li></ul><h3 id="outputpath" tabindex="-1"><a class="header-anchor" href="#outputpath" aria-hidden="true">#</a> outputPath</h3><ul><li><p>类型: <code>string</code></p></li><li><p>默认值: <code>dist</code></p></li><li><p>详情:</p><p>指定输出路径。</p></li></ul><div class="custom-container tip"><p class="custom-container-title">提示</p><p>不允许设定为 <code>src</code>、<code>public</code>、<code>pages</code> 等约定目录。</p></div><h3 id="plugins" tabindex="-1"><a class="header-anchor" href="#plugins" aria-hidden="true">#</a> plugins</h3><ul><li><p>类型: <code>Array(string)</code></p></li><li><p>默认值: <code>[]</code></p></li><li><p>详情:</p><p>配置额外的 <code>fes</code> 插件。 数组项为指向插件的路径,可以是 npm 依赖、相对路径或绝对路径。如果是相对路径,则会从项目根目录开始找。</p></li><li><p>示例:</p></li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">plugins</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
||
<span class="token comment">// npm 依赖</span>
|
||
<span class="token string">'fes-plugin-hello'</span><span class="token punctuation">,</span>
|
||
<span class="token comment">// 相对路径</span>
|
||
<span class="token string">'./plugin'</span><span class="token punctuation">,</span>
|
||
<span class="token comment">// 绝对路径</span>
|
||
<span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>__dirname<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">/plugin.js</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><h3 id="proxy" tabindex="-1"><a class="header-anchor" href="#proxy" aria-hidden="true">#</a> proxy</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>配置代理能力。</p></li><li><p>示例:</p></li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">proxy</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token string-property property">'/v2'</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">target</span><span class="token operator">:</span> <span class="token string">'https://api.douban.com/'</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">changeOrigin</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><p>然后访问 <code>/v2/movie/in_theaters_proxy</code> 就能访问到 <a href="http://api.douban.com/v2/movie/in_theaters_proxy" target="_blank" rel="noopener noreferrer">http://api.douban.com/v2/movie/in_theaters_proxy<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的数据。</p><h3 id="publicpath" tabindex="-1"><a class="header-anchor" href="#publicpath" aria-hidden="true">#</a> publicPath</h3><ul><li><p>类型: <code>string</code></p></li><li><p>默认值: <code>/</code></p></li><li><p>详情:</p><p>静态资源 publicPath。当打包的时候在静态文件路径前面添加 <code>publicPath</code> 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 <code>publicPath</code> 的值设为 CDN 的值就可以。</p></li></ul><h3 id="router" tabindex="-1"><a class="header-anchor" href="#router" aria-hidden="true">#</a> router</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{ mode: 'hash', base: '/' }</code></p></li><li><p>详情:</p><p>配置路由,具体请查看指南中关于路由的介绍</p></li></ul><h3 id="singular" tabindex="-1"><a class="header-anchor" href="#singular" aria-hidden="true">#</a> singular</h3><ul><li><p>类型: <code>boolean</code></p></li><li><p>默认值: <code>false</code></p></li><li><p>详情:</p><p>配置是否启用单数模式的目录。 比如 <code>src/pages</code> 的约定在开启后为 <code>src/page</code> 目录,@fesjs/fes-plugins 插件也遵照此配置的约定。</p></li></ul><h3 id="targets" tabindex="-1"><a class="header-anchor" href="#targets" aria-hidden="true">#</a> targets</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>配置需要兼容的浏览器最低版本,会自动引入 polyfill 和做语法转换。</p></li></ul><h3 id="terseroptions" tabindex="-1"><a class="header-anchor" href="#terseroptions" aria-hidden="true">#</a> terserOptions</h3><ul><li>类型: <code>object</code></li><li>默认值:</li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">const</span> defaultTerserOptions <span class="token operator">=</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">compress</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token comment">// turn off flags with small gains to speed up minification</span>
|
||
<span class="token literal-property property">arrows</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">collapse_vars</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 0.3kb</span>
|
||
<span class="token literal-property property">comparisons</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">computed_props</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">hoist_funs</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">hoist_props</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">hoist_vars</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">inline</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">loops</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">negate_iife</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">properties</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">reduce_funcs</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">reduce_vars</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">switches</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">toplevel</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">typeofs</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||
|
||
<span class="token comment">// a few flags with noticeable gains/speed ratio</span>
|
||
<span class="token comment">// numbers based on out of the box vendor bundle</span>
|
||
<span class="token literal-property property">booleans</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 0.7kb</span>
|
||
<span class="token literal-property property">if_return</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 0.4kb</span>
|
||
<span class="token literal-property property">sequences</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 0.7kb</span>
|
||
<span class="token literal-property property">unused</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 2.3kb</span>
|
||
|
||
<span class="token comment">// required features to drop conditional branches</span>
|
||
<span class="token literal-property property">conditionals</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">dead_code</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">evaluate</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">mangle</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">safari10</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><ul><li><p>详情:</p><p>配置 <a href="https://github.com/terser/terser#minify-options" target="_blank" rel="noopener noreferrer">压缩器 terser 的配置项<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p></li></ul><h3 id="title" tabindex="-1"><a class="header-anchor" href="#title" aria-hidden="true">#</a> title</h3><ul><li><p>类型: <code>string</code></p></li><li><p>详情:</p><p>html 页面标题</p></li></ul><h2 id="webpack-专属配置" tabindex="-1"><a class="header-anchor" href="#webpack-专属配置" aria-hidden="true">#</a> webpack 专属配置</h2><h3 id="analyze" tabindex="-1"><a class="header-anchor" href="#analyze" aria-hidden="true">#</a> analyze</h3><ul><li>类型: <code>object</code></li><li>默认值:</li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token punctuation">{</span>
|
||
<span class="token literal-property property">analyzerMode</span><span class="token operator">:</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_MODE</span> <span class="token operator">||</span> <span class="token string">'server'</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">analyzerPort</span><span class="token operator">:</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_PORT</span> <span class="token operator">||</span> <span class="token number">8888</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">openAnalyzer</span><span class="token operator">:</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_OPEN</span> <span class="token operator">!==</span> <span class="token string">'none'</span><span class="token punctuation">,</span>
|
||
<span class="token comment">// generate stats file while ANALYZE_DUMP exist</span>
|
||
<span class="token literal-property property">generateStatsFile</span><span class="token operator">:</span> <span class="token operator">!</span><span class="token operator">!</span>process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_DUMP</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">statsFilename</span><span class="token operator">:</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_DUMP</span> <span class="token operator">||</span> <span class="token string">'stats.json'</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">logLevel</span><span class="token operator">:</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">ANALYZE_LOG_LEVEL</span> <span class="token operator">||</span> <span class="token string">'info'</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">defaultSizes</span><span class="token operator">:</span> <span class="token string">'parsed'</span> <span class="token comment">// stat // gzip</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></div><ul><li><p>详情:</p><p>构建结果分析,当配置 <code>p<wbr>rocess.env.ANALYZE</code> 时开启,例如执行<code>ANALYZE=1 fes build</code></p></li></ul><h3 id="chainwebpack" tabindex="-1"><a class="header-anchor" href="#chainwebpack" aria-hidden="true">#</a> chainWebpack</h3><ul><li><p>类型:<code>function</code></p></li><li><p>默认值:<code>null</code></p></li><li><p>详情:</p><p>通过 <a href="https://github.com/neutrinojs/webpack-chain" target="_blank" rel="noopener noreferrer">webpack-chain<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的 API 修改 webpack 配置。</p></li></ul><p>示例:</p><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token function">chainWebpack</span><span class="token punctuation">(</span><span class="token parameter">memo<span class="token punctuation">,</span> <span class="token punctuation">{</span> env<span class="token punctuation">,</span> webpack <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||
<span class="token comment">// 删除 fes 内置插件</span>
|
||
memo<span class="token punctuation">.</span>plugins<span class="token punctuation">.</span><span class="token function">delete</span><span class="token punctuation">(</span><span class="token string">'copy'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><h3 id="cssloader" tabindex="-1"><a class="header-anchor" href="#cssloader" aria-hidden="true">#</a> cssLoader</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>''</code></p></li><li><p>详情:</p><p>设置 <a href="https://github.com/webpack-contrib/css-loader#options" target="_blank" rel="noopener noreferrer">css-loader 配置项<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="copy" tabindex="-1"><a class="header-anchor" href="#copy" aria-hidden="true">#</a> copy</h3><ul><li><p>类型: <code>Array(string) || Array(object)</code></p></li><li><p>默认值: <code>[]</code></p></li><li><p>详情:</p><p>设置要复制到输出目录的文件、文件夹。</p><p>配置约定 <code>from-to</code> 规则, 其中 <code>from</code> 是相对于 <code>cwd</code> 的路径,<code>to</code> 是相对于输出路径的路径。</p></li><li><p>示例:</p></li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">copy</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">from</span><span class="token operator">:</span> <span class="token string">'/src/assets/images'</span><span class="token punctuation">,</span>
|
||
<span class="token literal-property property">to</span><span class="token operator">:</span> <span class="token string">'assets/images'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><p>上面示例中,实现了将 <code>cwd</code> 路径中的 <code>/src/assets/images</code> 文件夹,在编译完成后,<code>copy</code> 到输出路径下的 <code>assets/images</code> 文件夹。</p><h3 id="devserver" tabindex="-1"><a class="header-anchor" href="#devserver" aria-hidden="true">#</a> devServer</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>配置开发服务器。支持以下子配置项:</p><ul><li>port,端口号,默认 <code>8000</code></li><li>host,默认 <code>localhost</code></li><li>https,是否启用 https server,同时也会开启 HTTP/2</li></ul><p>启用 port 和 host 也可以通过环境变量 <code>PORT</code> 和 <code>HOST</code> 临时指定。</p></li></ul><h3 id="devtool" tabindex="-1"><a class="header-anchor" href="#devtool" aria-hidden="true">#</a> devtool</h3><ul><li><p>类型: <code>string</code></p></li><li><p>默认值: <code>cheap-module-source-map</code> in dev, <code>undefined</code> in build</p></li><li><p>详情:</p><p>用户配置 sourcemap 类型。详见 <a href="https://webpack.js.org/configuration/devtool/#devtool" target="_blank" rel="noopener noreferrer"> webpack#devtool 配置<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="exportstatic" tabindex="-1"><a class="header-anchor" href="#exportstatic" aria-hidden="true">#</a> exportStatic</h3><ul><li>类型: <code>object</code></li><li>默认值: <code>{}</code></li><li>详情:</li></ul><p>配置 <code>html</code> 的输出形式,默认只输出 <code>index.html</code>。</p><p>如果开启 <code>exportStatic</code>,则会针对每个路由输出 <code>html</code> 文件。</p><p>比如以下路由,</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>/
|
||
/users
|
||
/list
|
||
</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></div><p>不开启 <code>exportStatic</code> 时,输出,</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>- index.html
|
||
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>设置 <code>exportStatic: {}</code> 后,输出,</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>- index.html
|
||
- users.html
|
||
- list.html
|
||
</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></div><h3 id="externals" tabindex="-1"><a class="header-anchor" href="#externals" aria-hidden="true">#</a> externals</h3><ul><li><p>类型:<code>object</code></p></li><li><p>默认值:<code>{}</code></p></li><li><p>详情:</p><p>设置哪些模块可以不被打包,通过 <code><script></code> 或其他方式引入。</p></li></ul><p>示例:</p><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">externals</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">vue</span><span class="token operator">:</span> <span class="token string">'window.Vue'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><h3 id="extrababelplugins" tabindex="-1"><a class="header-anchor" href="#extrababelplugins" aria-hidden="true">#</a> extraBabelPlugins</h3><ul><li>类型: <code>array</code></li><li>默认值: <code>[]</code></li><li>详情:</li></ul><p>配置额外的 <code>babel</code> 插件。</p><ul><li>示例:</li></ul><div class="language-javascript line-numbers-mode" data-ext="js"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
|
||
<span class="token literal-property property">extraBabelPlugins</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">'import'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token literal-property property">libraryName</span><span class="token operator">:</span> <span class="token string">'ant-design-vue'</span><span class="token punctuation">,</span> <span class="token literal-property property">libraryDirectory</span><span class="token operator">:</span> <span class="token string">'es'</span><span class="token punctuation">,</span> <span class="token literal-property property">style</span><span class="token operator">:</span> <span class="token string">'css'</span> <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</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></div><h3 id="extrababelpresets" tabindex="-1"><a class="header-anchor" href="#extrababelpresets" aria-hidden="true">#</a> extraBabelPresets</h3><ul><li>类型: <code>array</code></li><li>默认值: <code>[]</code></li><li>详情:</li></ul><p>配置额外的 <code>babel</code> 插件集。</p><h3 id="extrapostcssplugins" tabindex="-1"><a class="header-anchor" href="#extrapostcssplugins" aria-hidden="true">#</a> extraPostCSSPlugins</h3><ul><li><p>类型: <code>array</code></p></li><li><p>默认值: <code>[]</code></p></li><li><p>详情:</p><p>设置额外的 <a href="https://github.com/postcss/postcss/blob/master/docs/plugins.md" target="_blank" rel="noopener noreferrer">postcss 插件<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="html" tabindex="-1"><a class="header-anchor" href="#html" aria-hidden="true">#</a> html</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>设置<a href="https://github.com/jantimon/html-webpack-plugin#options" target="_blank" rel="noopener noreferrer">html-webpack-plugin<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="lessloader" tabindex="-1"><a class="header-anchor" href="#lessloader" aria-hidden="true">#</a> lessLoader</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>设置 <a href="https://github.com/webpack-contrib/less-loader" target="_blank" rel="noopener noreferrer">less-loader 配置项<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="nodemodulestransform" tabindex="-1"><a class="header-anchor" href="#nodemodulestransform" aria-hidden="true">#</a> nodeModulesTransform</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{ exclude: [] }</code></p></li><li><p>详情:</p><p>默认编译所有 <code>node_modules</code> 下的包,可以通过配置 <code>exclude</code> 来跳过某些包,以提高编译速度。</p></li></ul><h3 id="postcssloader" tabindex="-1"><a class="header-anchor" href="#postcssloader" aria-hidden="true">#</a> postcssLoader</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值: <code>{}</code></p></li><li><p>详情:</p><p>设置 <a href="https://github.com/postcss/postcss-loader#options" target="_blank" rel="noopener noreferrer">postcss-loader 配置项<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>。</p></li></ul><h3 id="vueloader" tabindex="-1"><a class="header-anchor" href="#vueloader" aria-hidden="true">#</a> vueLoader</h3><ul><li><p>类型: <code>object</code></p></li><li><p>默认值:<code>{}</code></p></li><li><p>详情:</p><p>配置 <a href="https://vue-loader.vuejs.org/zh/options.html" target="_blank" rel="noopener noreferrer">Vue Loader<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p></li></ul><h2 id="vite-专属配置" tabindex="-1"><a class="header-anchor" href="#vite-专属配置" aria-hidden="true">#</a> Vite 专属配置</h2><h3 id="viteoption" tabindex="-1"><a class="header-anchor" href="#viteoption" aria-hidden="true">#</a> viteOption</h3><ul><li><p>类型: <code>object</code></p></li><li><p>详情:</p><p>Vite 的配置,详情请看 <a href="https://cn.vitejs.dev/config/" target="_blank" rel="noopener noreferrer">Vite Config<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p></li></ul><h3 id="vitevueplugin" tabindex="-1"><a class="header-anchor" href="#vitevueplugin" aria-hidden="true">#</a> viteVuePlugin</h3><ul><li><p>类型: <code>object</code></p></li><li><p>详情:</p><p>自定义 <a href="https://github.com/vitejs/vite/tree/main/packages/plugin-vue" target="_blank" rel="noopener noreferrer">@vitejs/plugin-vue<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的配置。</p></li></ul><h3 id="vitevuejsx" tabindex="-1"><a class="header-anchor" href="#vitevuejsx" aria-hidden="true">#</a> viteVueJsx</h3><ul><li><p>类型: <code>object</code></p></li><li><p>详情:</p><p>自定义 <a href="https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx" target="_blank" rel="noopener noreferrer">@vitejs/plugin-vue-jsx<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的配置。</p></li></ul><h3 id="vitelegacy" tabindex="-1"><a class="header-anchor" href="#vitelegacy" aria-hidden="true">#</a> viteLegacy</h3><ul><li><p>类型: <code>object</code></p></li><li><p>详情:</p><p>自定义 <a href="https://github.com/vitejs/vite/tree/main/packages/plugin-legacy" target="_blank" rel="noopener noreferrer">@vitejs/plugin-legacy<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的配置。</p></li></ul><h3 id="vitehtml" tabindex="-1"><a class="header-anchor" href="#vitehtml" aria-hidden="true">#</a> viteHtml</h3><ul><li><p>类型: <code>object</code></p></li><li><p>详情:</p><p>自定义 <a href="https://github.com/vbenjs/vite-plugin-html" target="_blank" rel="noopener noreferrer">vite-plugin-html<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 的配置。</p></li></ul><h2 id="更多配置项" tabindex="-1"><a class="header-anchor" href="#更多配置项" aria-hidden="true">#</a> 更多配置项</h2><p>Fes.js 允许插件注册配置,如果你使用插件,肯定会在插件里找到更多配置项。</p></div><!--[--><!--]--></div><footer class="page-meta"><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/WeBankFinTech/fes.js/edit/next/docs/reference/config/README.md" rel="noopener noreferrer" target="_blank" aria-label="在 GitHub 上编辑此页"><!--[--><!--]--> 在 GitHub 上编辑此页 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">贡献者: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: haizekuo@gmail.com">winixt</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!----><!--]--></div>
|
||
<script type="module" src="/assets/app.bd9c95b7.js" defer></script>
|
||
</body>
|
||
</html>
|