Skip to content

Commit

Permalink
fix: update log (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
wre232114 authored Mar 15, 2023
1 parent 1f8da71 commit b1684b1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @farmfe/core

## 0.4.6

### Patch Changes

- Fix update log

## 0.4.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@farmfe/core",
"version": "0.4.5",
"version": "0.4.6",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
Expand Down
16 changes: 10 additions & 6 deletions packages/core/src/server/hmr-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { DevServer } from './index.js';
// import debounce from 'lodash.debounce';
import { Logger } from '../logger.js';
import { relative } from 'path';
import { isAbsolute, relative } from 'path';
import chalk from 'chalk';
import type { Resource } from '@farmfe/runtime/src/resource-loader.js';
import { JsUpdateResult } from '../../binding/binding.js';
Expand Down Expand Up @@ -47,11 +47,15 @@ export class HmrEngine {
this._updateQueue = [];
let updatedFilesStr = queue
.map((item) => {
const resolvedPath = this._compiler.transformModulePath(
this._compiler.config.config.root,
item
);
return relative(this._compiler.config.config.root, resolvedPath);
if (isAbsolute(item)) {
return relative(this._compiler.config.config.root, item);
} else {
const resolvedPath = this._compiler.transformModulePath(
this._compiler.config.config.root,
item
);
return relative(this._compiler.config.config.root, resolvedPath);
}
})
.join(', ');
if (updatedFilesStr.length >= 100) {
Expand Down

0 comments on commit b1684b1

Please sign in to comment.