From 266e43bf266327ddf481e99a3bc01ca9b1b5fc40 Mon Sep 17 00:00:00 2001 From: unadlib Date: Sat, 19 Jun 2021 02:18:37 +0800 Subject: [PATCH] docs(doc): update readme --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 94482ec..3dfc7b7 100644 --- a/README.md +++ b/README.md @@ -84,22 +84,7 @@ const { createWebpackConfig } = require('fronts-bundler'); module.exports = createWebpackConfig(originalWebpackConfig); ``` -3. Load `app1/src/App.jsx` with `useApp()` to import `app2`. - -```jsx -import React from 'react'; -import { useApp } from 'fronts-react'; - -export const App = () => { - const App2 = useApp({ - name: 'app2', - loader: () => import('app2/src/bootstrap'), - }); - return ; -}; -``` - -4. Define the default exported bootstrap function in `app2/src/bootstrap.jsx` and use `boot()` to get it booted. +3. Define the default exported bootstrap function in `app2/src/bootstrap.jsx` and use `boot()` to get it booted. ```jsx import React from 'react'; @@ -117,6 +102,25 @@ export default function render(element) { boot(render, document.getElementById('root')); ``` +4. Load `app1/src/App.jsx` with `useApp()` to import `app2`. + +```jsx +import React from 'react'; +import { useApp } from 'fronts-react'; + +export const App = () => { + const App2 = useApp({ + name: 'app2', + loader: () => import('app2/src/bootstrap'), + }); + return ; +}; +``` + +## Examples + +- [Simple Example](https://github.com/unadlib/fronts-example) + ## APIs | API | Isolation | @@ -144,10 +148,6 @@ The most popular frontend frameworks are React, Vue and Angular. When the micro | Module Federation | Webpack
site.json | Dependency Management ✅
Monorepo ✅
Version Management ❌ | | Version Control | Webpack
site.json
Registry Server | Dependency Management ✅
Monorepo ✅
Version Management ✅ | -## Examples - -- [Simple Example](https://github.com/unadlib/fronts-example) - ## Debugger/Logger Use `getMeta()`, it helps you to get the dependency mapping information.