Skip to content

Commit 7318071

Browse files
committed
fix: resolve cwd path to config
1 parent bac136c commit 7318071

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = function posthtmlrc (ctx, path, options) {
3535
const defaults = { cwd: process.cwd(), env: process.env.NODE_ENV }
3636

3737
ctx = assign(defaults, ctx)
38-
path = path || process.cwd()
38+
path = path || ctx.cwd
3939
options = assign({}, options)
4040

4141
if (ctx.env === undefined) {
@@ -46,9 +46,7 @@ module.exports = function posthtmlrc (ctx, path, options) {
4646
.load(path)
4747
.then((result) => {
4848
if (!result) {
49-
console.log(
50-
'PostHTML Config could not be loaded. Please check your PostHTML Config.'
51-
)
49+
throw new Error('PostHTML Config could not be loaded. Please check your PostHTML Config.');
5250
}
5351

5452
return result ? result.config : {}

0 commit comments

Comments
 (0)