From 64b0390c88ef76cbb775b5168d11b6553894792f Mon Sep 17 00:00:00 2001 From: simonhaenisch Date: Tue, 27 Nov 2018 21:29:40 +1300 Subject: [PATCH] fix: properly resolve path to highlight.js stylesheets This fixes an issue with hightlight.js stylesheet paths not being resolved properly if this packages is used as a dev dependency in another package. Fixes #21. --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index fdf5845..e97293b 100755 --- a/index.js +++ b/index.js @@ -152,9 +152,8 @@ async function main(args, config) { } const highlightStylesheet = path.resolve( - __dirname, - 'node_modules', - 'highlight.js', + path.dirname(require.resolve('highlight.js')), + '..', 'styles', `${config.highlight_style}.css`, );