Skip to content

Commit

Permalink
fix: fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Caedman Ziwen Lan committed Nov 1, 2023
1 parent 529fec3 commit 9afb904
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apitable/widget-cli",
"description": "help you to build awesome apitable widget",
"version": "1.0.5",
"version": "1.0.8",
"author": "APITable PTE. LTD.",
"bin": {
"widget-cli": "./bin/run"
Expand Down
16 changes: 10 additions & 6 deletions src/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ export function getWidgetConfig(rootDir?: string): IWidgetConfig {

export function getWebpackCustomConfig(rootDir?: string): any {
rootDir = rootDir ?? findWidgetRootDir();
try {
const common = require(path.join(rootDir, Config.webpackConfigFileName));
return common;
} catch (e) {
console.error(e)
return {}
const checkExist = fse.existsSync(path.join(rootDir, Config.webpackConfigFileName))
if(checkExist) {
try {
const common = require(path.join(rootDir, Config.webpackConfigFileName));
return common;
} catch (e) {
console.error(e)
return {}
}
}
return {}
}

export function getPackageJSON(rootDir?: string) {
Expand Down

0 comments on commit 9afb904

Please sign in to comment.