Skip to content

Commit c94624e

Browse files
ranfdevJasper De Moor
authored andcommitted
fix 'Cannot read property 'posthtml' of null (#1578)
fixes #1574
1 parent 1701f9b commit c94624e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/transforms/posthtml.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ async function transform(asset) {
2525
}
2626

2727
async function getConfig(asset) {
28-
let config =
29-
(await asset.getPackage()).posthtml ||
30-
(await asset.getConfig([
31-
'.posthtmlrc',
32-
'.posthtmlrc.js',
33-
'posthtml.config.js'
34-
]));
28+
let config = await asset.getConfig(
29+
['.posthtmlrc', '.posthtmlrc.js', 'posthtml.config.js'],
30+
{
31+
packageKey: 'posthtml'
32+
}
33+
);
3534
if (!config && !asset.options.minify) {
3635
return;
3736
}

0 commit comments

Comments
 (0)