Skip to content

Commit e26a8bc

Browse files
author
jiao.shen
committed
fix(server): 解决入口没找到时compile全部资源的问题
1 parent 2e04c64 commit e26a8bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/commands/server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ exports.run = (options) => {
7171

7272
function parse(req, res, format) {
7373
const dateFormat = 'YY.MM.DD HH:mm:ss';
74+
/*eslint-disable */
7475
const status = (function () {
7576
switch (true) {
7677
case 500 <= res.statusCode:
@@ -83,6 +84,7 @@ exports.run = (options) => {
8384
return '\x1b[32m';
8485
}
8586
})();
87+
/*eslint-disable */
8688

8789
let contentLength = res._contentLength || '';
8890
if (contentLength) {
@@ -166,6 +168,7 @@ exports.run = (options) => {
166168
if (project.check()) {
167169
compiler = project.getServerCompiler(function (config) {
168170
let nextConfig = extend({}, config);
171+
// entry应该是个空对象, 这样如果没有找到请求对应的entry, 就不会编译全部入口
169172
nextConfig.entry = {};
170173

171174
// 将webpack entry设置为当前请求的资源

0 commit comments

Comments
 (0)