Skip to content

Commit

Permalink
feat: support project config file with js extension (#122)
Browse files Browse the repository at this point in the history
* feat: support running devkit commands on sub directory.

close #114

* feat: support project config file with js extension
  • Loading branch information
cpselvis authored Nov 5, 2019
1 parent bc819f4 commit f2b2cee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/core/devkit/config.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}`;
Expand Down

0 comments on commit f2b2cee

Please sign in to comment.