Base on Webpack5 Module Federation Micro Frontends solution!
English | 简体中文
- Initialize EMP project:
npx @efox/emp-cli init
npm i -g @efox/emp-cli
or yarn global add @efox/emp-cli
-
emp init
Initialize project -
emp dev
Developmentemp dev --hot
Hot updateemp dev --open
Open the development page
-
emp build
Buildemp build --env
Specify the deployment environmentemp build --analyze
Analyzeemp build --ts
Build the production environment, generateindex.d.ts
todist
directory at the same timeemp build --ts -p [types path] -n [types name]
types path
default relative path isdist
、types name
default type file name isindex.d.ts
-
emp tsc
generateindex.d.ts
todist
directoryemp build --ts -p [types path] -n [types name]
types path
default relative path isdist
、types name
default type file name isindex.d.ts
-
emp tss <remote-url>
Synchronization remote typeemp tss <remote-url> -p [types path] -n [types name]
types path
default relative path issrc
、types name
default type file name isempType.d.ts
-
emp serve
Formal service -
emp
help
- MODE_ENV webpack mode Environment variable , use
process.env.EMP_ENV
- EMP_ENV use
emp dev --env prod
Set up to distinguish the deployment environment , useprocess.env.EMP_ENV
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true // eslint Auto format
},
"typescript.tsdk": "node_modules/typescript/lib", // ts css module type check
"typescript.enablePromptUseWorkspaceTsdk": true // ts css module type check
}