Skip to content

Commit 70ed11d

Browse files
authored
Merge pull request #19 from anri-asaturov/master
Fix usage as a local dependency
2 parents 3b43093 + 14e1fbc commit 70ed11d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@
9898
var templatePath = path.resolve(__dirname, '..', 'dist', 'template.html');
9999
var template = utils.readFileSync(templatePath);
100100

101-
var cssFilePath = path.resolve(__dirname, '..', 'node_modules', 'diff2html', 'dist', 'diff2html.min.css');
101+
var diff2htmlPath = path.join(path.dirname(require.resolve('diff2html')), '..');
102+
103+
var cssFilePath = path.resolve(diff2htmlPath, 'dist', 'diff2html.min.css');
102104
var cssContent = utils.readFileSync(cssFilePath);
103105

104-
var jsUiFilePath = path.resolve(__dirname, '..', 'node_modules', 'diff2html', 'dist', 'diff2html-ui.min.js');
106+
var jsUiFilePath = path.resolve(diff2htmlPath, 'dist', 'diff2html-ui.min.js');
105107
var jsUiContent = utils.readFileSync(jsUiFilePath);
106108

107109
return template

0 commit comments

Comments
 (0)