Skip to content

Commit

Permalink
feat(fragment): add NODEPACK_SUPPRESS_FRAGMENT_ERROR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed May 6, 2020
1 parent 2620cc9 commit 5b2e4e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@nodepack/fragment/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export function loadFragment<T = any> (file: string, cwd: string = process.cwd()
const moduleFile = path.join(outputDir, file)
return loadModule(moduleFile, outputDir)
} catch (e) {
console.log(`Error while loading fragment ${file}`, e)
if (!process.env.NODEPACK_SUPPRESS_FRAGMENT_ERROR) {
console.log(`Error while loading fragment ${file}`, e)
}
return null
}
}

0 comments on commit 5b2e4e1

Please sign in to comment.