From c94624ec976d63aa5da4db78d20985ec15ec5435 Mon Sep 17 00:00:00 2001 From: ranfdev Date: Mon, 18 Jun 2018 17:27:02 +0200 Subject: [PATCH] fix 'Cannot read property 'posthtml' of null (#1578) fixes #1574 --- src/transforms/posthtml.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/transforms/posthtml.js b/src/transforms/posthtml.js index 29f9f2d6b20..59f0f586b4c 100644 --- a/src/transforms/posthtml.js +++ b/src/transforms/posthtml.js @@ -25,13 +25,12 @@ async function transform(asset) { } async function getConfig(asset) { - let config = - (await asset.getPackage()).posthtml || - (await asset.getConfig([ - '.posthtmlrc', - '.posthtmlrc.js', - 'posthtml.config.js' - ])); + let config = await asset.getConfig( + ['.posthtmlrc', '.posthtmlrc.js', 'posthtml.config.js'], + { + packageKey: 'posthtml' + } + ); if (!config && !asset.options.minify) { return; }