diff --git a/docs/local-dev-frontend.md b/docs/local-dev-frontend.md new file mode 100644 index 00000000000..5a49c1d409c --- /dev/null +++ b/docs/local-dev-frontend.md @@ -0,0 +1,31 @@ +# frontend dev + +前端架构: +- react +- patternfly + +## build +打包逻辑: +- yarn run build + - yarn clean + - yarn generate(编译 plugin sdk) + - yarn generate-graphql(`graphql-codegen --config graphql-codegen.yml`) + - yarn build-plugin-sdk(`yarn --cwd packages/console-dynamic-plugin-sdk build`) + - yarn clean && yarn validate && yarn compile && yarn generate + - yarn build-console-plugin-shared(`yarn --cwd packages/console-plugin-shared build`) + - yarn ts-node ./node_modules/.bin/webpack(编译主包) + +优化: +- type check +- SWC + +## entrypoint + +## console extensions +console 插件: +- static plugin(`package.json.consolePlugin.entry`) +- dynamic plugin(`console-extensions.json`) + + +- 核心模块`@console/app`,项目工程[位于](../frontend/packages/console-app) + diff --git a/frontend/package.json b/frontend/package.json index ac54517edcd..55acc313e09 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,6 +15,7 @@ "clean": "rm -rf ./public/dist", "dev": "yarn clean && yarn generate && REACT_REFRESH=true NODE_OPTIONS=--max-old-space-size=4096 yarn ts-node ./node_modules/.bin/webpack serve --mode=development --progress", "dev-once": "yarn clean && yarn generate && NODE_OPTIONS=--max-old-space-size=4096 yarn ts-node ./node_modules/.bin/webpack --mode=development", + "dev-debug": "NODE_OPTIONS=--max-old-space-size=4096 TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' TS_NODE_TRANSPILE_ONLY=true TS_NODE_DEBUG=true node --inspect-brk --require ts-node/register ./node_modules/.bin/webpack --mode=development", "build": "yarn clean && yarn generate && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 yarn ts-node ./node_modules/.bin/webpack --mode=production", "check-cycles": "CHECK_CYCLES=true yarn dev-once", "coverage": "jest --coverage .", diff --git a/frontend/webpack.config.ts b/frontend/webpack.config.ts index 50beb535ff1..bb042e5b2ee 100644 --- a/frontend/webpack.config.ts +++ b/frontend/webpack.config.ts @@ -263,6 +263,7 @@ const config: Configuration = { ]), extractCSS, virtualModules, + // console plugin 打包 new ConsoleActivePluginsModule(resolvePluginPackages(), virtualModules), ...(REACT_REFRESH ? [ @@ -275,7 +276,7 @@ const config: Configuration = { : []), ], devtool: 'cheap-module-source-map', - stats: 'minimal', + stats: 'verbose', }; if (CHECK_CYCLES === 'true') {