Skip to content

Commit

Permalink
Merge pull request #44 from micro-zoe/optimizationEnvironment
Browse files Browse the repository at this point in the history
环境变量兼容1.0版本变量显示
  • Loading branch information
raoenhui authored Dec 21, 2023
2 parents d919c59 + ba0a446 commit a4cc853
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
20 changes: 20 additions & 0 deletions src/pages/devtools/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const MICRO_APP_ENV_INFO = {
describe: '子应用的静态资源前缀',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/env?id=__micro_app_public_path__',
},
__MICRO_APP_URL__: {
describe: '子应用的网址',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/env?id=__micro_app_base_route__',
},
__MICRO_APP_BASE_URL__: {
describe: '子应用的基础网址',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/env?id=__micro_app_base_route__',
Expand All @@ -26,4 +30,20 @@ export const MICRO_APP_ENV_INFO = {
describe: '子应用的基础路由',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/env?id=__micro_app_base_route__',
},
__MICRO_APP_SANDBOX_TYPE__: {
describe: '子应用沙箱模式',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/configure?id=iframe',
},
__MICRO_APP_UMD_MODE__: {
describe: '是否开启UMD模式',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/framework/vue?id=_1%e3%80%81%e5%bc%80%e5%90%afumd%e6%a8%a1%e5%bc%8f%ef%bc%8c%e4%bc%98%e5%8c%96%e5%86%85%e5%ad%98%e5%92%8c%e6%80%a7%e8%83%bd',
},
__MICRO_APP_PRE_RENDER__: {
describe: '是否开启预渲染',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/router',
},
__MICRO_APP_BASE_APPLICATION__: {
describe: '是否是主应用',
url: 'https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/env?id=__micro_app_base_application__',
},
};
2 changes: 1 addition & 1 deletion src/pages/devtools/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DevToolsPage extends React.PureComponent<DevToolsPageProps, DevToolsPageSt
const allKey = JSON.stringify(Object.keys(thisWindow));
let microAppInfo = {};
for (let el of JSON.parse(allKey)){
if (el.indexOf('__MICRO_APP') > -1){
if (el.indexOf('__MICRO_APP') > -1 && ['__MICRO_APP_WINDOW__', '__MICRO_APP_SANDBOX__'].indexOf(el) == -1){
microAppInfo[el] = thisWindow[el];
}
}
Expand Down
7 changes: 0 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const webpackConfigs = [{
'popup-app': utils.fullPath('src/app/popup/index.tsx'),
'devtools-app': utils.fullPath('src/app/devtools/index.tsx'),
'simulation-app': utils.fullPath('src/app/simulation/index.tsx'),
'popup-open': utils.fullPath('src/app/popup-open/index.tsx'),
},
output: {
path: process.env.DIST_PATH,
Expand Down Expand Up @@ -226,12 +225,6 @@ const webpackConfigs = [{
chunks: ['simulation-app'],
cache: false,
}),
new HtmlWebpackPlugin({
template: utils.fullPath('src/app/popup-open/index.html'),
filename: 'popup-open.html',
chunks: ['popup-open'],
cache: false,
}),
// Webpack plugin that runs TypeScript type checker on a separate process.
new ForkTsCheckerWebpackPlugin(),
],
Expand Down

0 comments on commit a4cc853

Please sign in to comment.