react-lib-tools 0.0.40 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-lib-tools",
3
- "version": "0.0.40",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
6
6
  "contributors": [
@@ -6,10 +6,12 @@ import { crawlPage } from "./utils/search/crawlPage";
6
6
  import type { SiteSearchPage } from "./utils/search/types";
7
7
 
8
8
  export async function compileSearchIndex({
9
+ chromeExecutablePath,
9
10
  filterSelector,
10
11
  host = "http://localhost:3000",
11
12
  outputPath = ["public", "generated"]
12
13
  }: {
14
+ chromeExecutablePath?: string | undefined;
13
15
  filterSelector?: string | undefined;
14
16
  host?: string;
15
17
  outputPath?: string[];
@@ -17,6 +19,7 @@ export async function compileSearchIndex({
17
19
  const recordsMap: Record<string, SiteSearchPage> = {};
18
20
 
19
21
  await crawlPage({
22
+ chromeExecutablePath,
20
23
  filterSelector,
21
24
  host,
22
25
  path: "/",
@@ -3,11 +3,13 @@ import { stopWords } from "./stopWords";
3
3
  import type { SiteSearchPage } from "./types";
4
4
 
5
5
  export async function crawlPage({
6
+ chromeExecutablePath,
6
7
  filterSelector,
7
8
  host,
8
9
  path,
9
10
  records
10
11
  }: {
12
+ chromeExecutablePath?: string | undefined;
11
13
  filterSelector?: string | undefined;
12
14
  host: string;
13
15
  path: string;
@@ -15,11 +17,11 @@ export async function crawlPage({
15
17
  }) {
16
18
  console.log(`Crawling ${host}${path} ...`);
17
19
 
18
- const executablePath = process.env.CHROME_PATH;
19
20
  const browser = await puppeteer.launch(
20
- executablePath
21
+ chromeExecutablePath
21
22
  ? {
22
- executablePath,
23
+ args: ["--no-sandbox", "--disable-setuid-sandbox"],
24
+ executablePath: chromeExecutablePath,
23
25
  headless: true
24
26
  }
25
27
  : {