/* 可以在终端输入:my, 打印以下内容 */
Usage: my [options] [command]
Options:
-h, --help display help for command
Commands:
start [port=3001] start run project
build build project
pack pack components
help [command] display help for command
/* runner.config.js */
const path = require('path');
module.exports = {
publicPath: '/', // 子应用base路径, 默认为包名
outputPath: './dist', // 打包文件输出地址;配置值时,基于项目根目录,默认为:'./libDist'
lessVariables: {},
webpackConfig: (config, options) => {
config.resolve.alias = {
'@resources': path.resolve(__dirname, 'src'),
'@/utils/request': path.resolve(__dirname, 'src/utils/request'),
'@router': path.resolve(__dirname, 'src/router'),
};
config.devServer.proxy = {
'/api': {
target: 'http://127.0.0.1:2001/',
changeOrigin: true,
}
};
config.plugins.push(
new options.moduleFederationPlugin({
name: 'app2',
shared: {
react: { singleton: true },
'react-dom': { singleton: true },
},
}),
);
return config;
},
};