Skip to content

Commit

Permalink
do we really need to set env before import? or just before run?
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed May 29, 2024
1 parent 3f88666 commit c5c5c2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ async function findAssetsToCopy(source: Input["source"]) {
console.groupCollapsed(`[INFO] Finding relevant assets…`);
let localAssets: string[] = [];
let remoteAssets: URL[] = [];
process.env["PUPPETEER_EXECUTABLE_PATH"] =
PUPPETEER_ENV.PUPPETEER_EXECUTABLE_PATH;
const { getAllSubResources } = require("subresources");
const { getAllSubResources } =
require("subresources") as typeof import("subresources");

const server = await new StaticServer().start();

Expand All @@ -182,6 +181,7 @@ async function findAssetsToCopy(source: Input["source"]) {
(url: URL) => url.origin === "https://user-images.githubusercontent.com",
];

Object.assign(process.env, PUPPETEER_ENV);
const mainPage = urlToPage(new URL(tmpOutputFile(source), server.url));
const pages = new Set([mainPage]);
for (const page of pages) {
Expand Down

0 comments on commit c5c5c2a

Please sign in to comment.