### Fes.js Build Configuration Example Source: https://github.com/webankfintech/fes.js/blob/master/docs/guide/config.md A common example of a build-time configuration file for Fes.js using defineBuildConfig. It demonstrates settings for public path, mock server, proxy, and layout options. ```js import { defineBuildConfig } from '@fesjs/fes'; export default defineBuildConfig({ publicPath: '/', mock: { prefix: '/v2', }, proxy: { '/v2': { target: 'https://api.douban.com/', changeOrigin: true, }, }, layout: { title: 'Fes.js', footer: 'Created by MumbelFe', multiTabs: false, menus: [ { name: 'index', }, { name: 'onepiece', }, { name: 'store', }, { name: 'simpleList', }, ], }, }); ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-utils/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-preset-built-in/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-runtime/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Install and Run fes.js App Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-swc/README.md Provides commands to create a new fes.js application, install its dependencies, and start the development server. Supports both pnpm and npm package managers. ```bash # Create template pnpm create @fesjs/fes-app myapp # Install dependencies pnpm i # Run pnpm dev ``` ```bash # Create template npx @fesjs/create-fes-app myapp # Install dependencies npm install # Run npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-qiankun/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-preset-built-in/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-vuex/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-utils/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-runtime/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-windicss/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-vuex/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-monaco-editor/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-login/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-pinia/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-qiankun/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-compiler/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-request/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-watermark/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-monaco-editor/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-model/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-request/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-login/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-pinia/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-access/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-jest/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-layout/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-enums/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-icon/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-jest/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-access/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Navigate to Plugin Directory and Install Dependencies Source: https://github.com/webankfintech/fes.js/blob/master/docs/reference/plugin/dev/index.md After creating the plugin project, navigate into the newly created directory and install all necessary project dependencies using a package manager like pnpm. ```bash cd pluginName & pnpm i ``` -------------------------------- ### create-fes-app Installation and Usage (pnpm/npm) Source: https://github.com/webankfintech/fes.js/blob/master/docs/reference/cli/index.md Demonstrates how to install the `create-fes-app` globally using pnpm or npm and then use it to create a new fes.js project named 'fes-app'. ```bash # 全局安装 pnpm global add @fesjs/create-fes-app # 创建模板 create-fes-app fes-app ``` ```bash # 全局安装 npm i -g @fesjs/create-fes-app # 创建模板 create-fes-app fes-app ``` -------------------------------- ### Create and Run Fes.js App with npm Source: https://github.com/webankfintech/fes.js/blob/master/docs/index.md This snippet shows how to create a new Fes.js application using npm, install its dependencies, and start the development server. ```bash # 创建模板 npx @fesjs/create-fes-app myapp # 安装依赖 npm install # 运行 npm run dev ``` -------------------------------- ### Create and Run Fes.js App with pnpm Source: https://github.com/webankfintech/fes.js/blob/master/docs/index.md This snippet demonstrates how to create a new Fes.js application using pnpm, install its dependencies, and start the development server. ```bash # 创建模板 pnpm create @fesjs/fes-app myapp # 安装依赖 pnpm i # 运行 pnpm dev ``` -------------------------------- ### Use Store in Non-Setup Context Source: https://github.com/webankfintech/fes.js/blob/master/docs/reference/plugin/plugins/pinia.md Illustrates how to use a Pinia store outside of the component `setup` function, for example, in `app.js` or lifecycle hooks, by passing the Fes Pinia instance. ```js import { pinia } from '@fesjs/fes'; import { useStore } from '@/store/main'; export const beforeRender = { loading: , action() { const { setRole } = accessApi; return new Promise((resolve) => { setTimeout(() => { const store = useStore(pinia); store.$patch({ userName: '李雷', role: 'admin', }); setRole('admin'); }, 1000); }); }, }; ``` -------------------------------- ### create-fes-app Project Creation (pnpm create/npx) Source: https://github.com/webankfintech/fes.js/blob/master/docs/reference/cli/index.md Shows recommended methods for creating a fes.js project using `pnpm create` or `npx`, ensuring the latest template is used. Includes steps for installing dependencies and running the development server. ```bash # 创建模板 pnpm create @fesjs/fes-app myapp # 安装依赖 pnpm i # 运行 pnpm dev ``` ```bash # 创建模板 npx @fesjs/create-fes-app myapp # 安装依赖 npm install # 运行 npm run dev ``` -------------------------------- ### Create and Run Fes.js App (npm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes/README.md Steps to create a new Fes.js application using npm, install dependencies, and start the development server. ```bash npx @fesjs/create-fes-app myapp npm install npm run dev ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-windicss/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Install create-fes-app CLI Source: https://github.com/webankfintech/fes.js/blob/master/docs/reference/plugin/dev/index.md Before creating a new plugin, you need to install the `create-fes-app` command-line interface globally. This tool scaffolds new Fes.js projects, including plugin templates. ```bash npm i -g @fesjs/create-fes-app ``` -------------------------------- ### Create and Run Fes.js App (pnpm) Source: https://github.com/webankfintech/fes.js/blob/master/packages/fes-plugin-watermark/README.md Steps to create a new Fes.js application using pnpm, install dependencies, and start the development server. ```bash pnpm create @fesjs/fes-app myapp pnpm i pnpm dev ``` -------------------------------- ### Start VitePress Development Server Source: https://github.com/webankfintech/fes.js/blob/master/docs/guide/contributing.md Starts the local development server for the project's documentation site, built with VitePress. This allows you to preview documentation changes in real-time. ```bash pnpm docs:dev ```