-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cb67a3
commit 9d440fa
Showing
14 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/npm-debug.log* | ||
/yarn-error.log | ||
/yarn.lock | ||
/package-lock.json | ||
|
||
# production | ||
/dist | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# umi | ||
/src/.umi | ||
/src/.umi-production | ||
/src/.umi-test | ||
/.env.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
**/*.md | ||
**/*.svg | ||
**/*.ejs | ||
**/*.html | ||
package.json | ||
.umi | ||
.umi-production | ||
.umi-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 80, | ||
"overrides": [ | ||
{ | ||
"files": ".prettierrc", | ||
"options": { "parser": "json" } | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { defineConfig } from 'umi'; | ||
|
||
export default defineConfig({ | ||
nodeModulesTransform: { | ||
type: 'none', | ||
}, | ||
layout: {}, | ||
qiankun: { | ||
master: { | ||
apps: [{ | ||
name: 'shop', | ||
entry: 'http://localhost:8001' | ||
}, { | ||
name: 'user', | ||
entry: 'http://localhost:8002' | ||
}] | ||
}, | ||
}, | ||
routes: [ | ||
{ | ||
path: '/', | ||
component: '@/layouts/index', | ||
routes: [ | ||
{ path: '/', component: '@/pages/index' }, | ||
{ path: '/shop', microApp: 'shop' }, | ||
{ path: '/user', microApp: 'user' }, | ||
] | ||
} | ||
], | ||
proxy: { | ||
'/api/shop': { | ||
target: 'http://localhost:8001', | ||
}, | ||
'/api/user': { | ||
target: 'http://localhost:8002', | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# umi project | ||
|
||
## Getting Started | ||
|
||
Install dependencies, | ||
|
||
```bash | ||
$ yarn | ||
``` | ||
|
||
Start the dev server, | ||
|
||
```bash | ||
$ yarn start | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"start": "PORT=8000 umi dev", | ||
"build": "umi build", | ||
"postinstall": "umi generate tmp", | ||
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", | ||
"test": "umi-test", | ||
"test:coverage": "umi-test --coverage" | ||
}, | ||
"gitHooks": { | ||
"pre-commit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,less,md,json}": [ | ||
"prettier --write" | ||
], | ||
"*.ts?(x)": [ | ||
"prettier --parser=typescript --write" | ||
] | ||
}, | ||
"dependencies": { | ||
"@ant-design/pro-layout": "^5.0.12", | ||
"@umijs/plugin-qiankun": "^2.10.0", | ||
"@umijs/preset-react": "1.x", | ||
"@umijs/test": "^3.2.17", | ||
"lint-staged": "^10.0.7", | ||
"prettier": "^1.19.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"umi": "^3.2.17", | ||
"yorkie": "^2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export const layout = { | ||
title: '商城管理', | ||
menuDataRender: () => ([{ | ||
name: '商铺管理', | ||
path: '/shop' | ||
}, { | ||
name: '用户管理', | ||
path: '/user' | ||
}]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.contaier { | ||
background: white; | ||
margin: 24px; | ||
padding: 24px; | ||
min-height: calc(100vh - 112px); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import styles from './index.less'; | ||
|
||
export default (props: any) => { | ||
return ( | ||
<div className={styles.contaier}> | ||
{props.children} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<h1>介绍</h1> | ||
<p> | ||
这是一个基于 umi 的微前端实践方案示例,具体教程可见:<a>hello</a> | ||
</p> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"importHelpers": true, | ||
"jsx": "react", | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"baseUrl": "./", | ||
"strict": true, | ||
"paths": { | ||
"@/*": ["src/*"], | ||
"@@/*": ["src/.umi/*"] | ||
}, | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"include": [ | ||
"mock/**/*", | ||
"src/**/*", | ||
"config/**/*", | ||
".umirc.ts", | ||
"typings.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
declare module '*.css'; | ||
declare module '*.less'; | ||
declare module "*.png"; | ||
declare module '*.svg' { | ||
export function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement | ||
const url: string | ||
export default url | ||
} |