Skip to content

Commit d45ec35

Browse files
committed
Now requiring Nightmare library on the fly so that it isn't hard linked to Electron until Electron is actually required.
1 parent cc528ba commit d45ec35

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-template",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "This library is responsible for expanding a template web page and then capturing it PNG or PDF.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/web-page-renderer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ICaptureOptions } from "./index";
22

3-
const Nightmare = require("nightmare");
4-
53
declare const document: any;
64

75
/**
@@ -130,6 +128,7 @@ export class WebPageRenderer implements IWebPageRenderer {
130128
}
131129
}
132130

131+
const Nightmare = require("nightmare");
133132
this.nightmare = new Nightmare(nightmareOptions);
134133

135134
this.nightmare.on('crashed', (evt: any) => {

0 commit comments

Comments
 (0)