diff --git a/package.json b/package.json index 4cf412fd..3c4910ce 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "cross-spawn": "^6.0.5", "easy-table": "^1.1.1", "figlet": "^1.2.3", - "import-fresh": "^3.0.0", + "import-fresh": "^3.1.0", "inquire": "^0.4.8", "inquirer": "^6.5.0", "js-yaml": "^3.13.1", diff --git a/src/core/devkit/config.ts b/src/core/devkit/config.ts index 73a0d059..54bc33aa 100644 --- a/src/core/devkit/config.ts +++ b/src/core/devkit/config.ts @@ -1,5 +1,6 @@ import fs from 'fs'; import path from 'path'; +import importFresh from 'import-fresh'; import stripComments from 'strip-json-comments'; import yaml from 'js-yaml'; import { DEVKIT_CONFIG } from '../../shared/constant'; @@ -85,7 +86,7 @@ export default class Config { loadJSConfigFile(filePath: string) { this.ctx.logger.debug(`Loading JS config file: ${filePath}`); try { - + return importFresh(filePath); } catch (e) { this.ctx.logger.debug(`Error reading JavaScript file: ${filePath}`); e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;