qiankun部署微前端
教程: https://qiankun.umijs.org/zh/guide/tutorial
部署信息: 主应用: react项目, 微应用react项目
bug: 跟着教程一步步来都没啥问题,直到下载rescripts插件,并重新更改webpack配置时保了错,如下:
// 教程配置
const { name } = require('./package');
module.exports = {
webpack: (config) => {
config.output.library = `${name}-[name]`;
config.output.libraryTarget = 'umd';
config.output.jsonpFunction = `webpackJsonp_${name}`;
config.output.globalObject = 'window';
return config;
},
devServer: (_) => {
const config = _;
config.headers = {
'Access-Control-Allow-Origin': '*',
};
config.historyApiFallback = true;
config.watchContentBase = false;
config.liveReload = false;
return config;
},
};