diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c19582b61..a795687ff 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @farmfe/core +## 0.4.6 + +### Patch Changes + +- Fix update log + ## 0.4.5 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 449e4219f..665636a09 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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", diff --git a/packages/core/src/server/hmr-engine.ts b/packages/core/src/server/hmr-engine.ts index 8f11efdaf..55447f260 100644 --- a/packages/core/src/server/hmr-engine.ts +++ b/packages/core/src/server/hmr-engine.ts @@ -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'; @@ -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) {