Skip to content

Commit 66a8e57

Browse files
andrewshawcarechrisvxd
authored andcommitted
feat: add support for puppeteer.launch options
1 parent 37dc447 commit 66a8e57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/server/Story2sketch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default class Story2sketch {
3232
symbolGutter = defaultSymbolGutter,
3333
querySelector = "#root",
3434
verbose = false,
35-
stories
35+
stories,
36+
puppeteerOptions = {}
3637
}) {
3738
this.output = output;
3839
this.url = url;
@@ -43,6 +44,7 @@ export default class Story2sketch {
4344
this.querySelector = querySelector;
4445
this.stories = stories;
4546
this.verbose = verbose;
47+
this.puppeteerOptions = puppeteerOptions;
4648

4749
// Sort viewports by width
4850
this.sortedViewports = Object.keys(viewports)
@@ -63,7 +65,7 @@ export default class Story2sketch {
6365
}
6466

6567
async init() {
66-
this.browser = await puppeteer.launch();
68+
this.browser = await puppeteer.launch(this.puppeteerOptions);
6769

6870
if (!this.stories || this.stories === "all") {
6971
if (this.verbose) {

0 commit comments

Comments
 (0)