This commit is contained in:
wanchun 2022-03-03 16:18:45 +08:00
commit 08e82807f8
3 changed files with 3 additions and 8 deletions

View File

@ -17,9 +17,6 @@ module.exports = function createDevServer(port, defaultConfig) {
const app = express();
// 初始化Mock数据
createMock(app);
const compiler = webpack(defaultConfig);
// devServer 自带支持,添加自定义插件。
@ -43,6 +40,8 @@ module.exports = function createDevServer(port, defaultConfig) {
}));
app.use('/static', express.static('src/static'));
// 初始化Mock数据
createMock(app);
opn(`http://localhost:${port}`);

View File

@ -15,7 +15,6 @@ const util = require('./util');
const router = express.Router();
// 根据参数个数获取配置
function getOption(arg) {
const len = arg.length;
@ -145,9 +144,6 @@ const createMock = function () {
proxy.on('error', (e) => {
log.error(e);
});
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setHeader('Host', url.parse(host).host);
});
process.nextTick(() => {
router.use((req, res) => {
proxy.web(req, res, {

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-cli",
"version": "0.4.7",
"version": "0.4.8",
"description": "一个好用的前端管理台快速开发框架",
"preferGlobal": true,
"scripts": {