Skip to content

Commit

Permalink
build: fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Feb 22, 2024
1 parent 5e942b3 commit b06c257
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/puppeteer-core/Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/
import {mkdir, readFile, readdir, writeFile} from 'fs/promises';
import Module from 'node:module';
import {join, dirname} from 'path/posix';
import path from 'path';
import posixPath from 'path/posix';

import esbuild from 'esbuild';
import {execa} from 'execa';
Expand Down Expand Up @@ -99,13 +100,13 @@ export const buildTask = task({
});
const builders = [];
for (const format of formats) {
const folder = join('lib', format, 'third_party');
const folder = posixPath.join('lib', format, 'third_party');
for (const name of packages) {
const path = join(folder, name, `${name}.js`);
const entrypoint = posixPath.join(folder, name, `${name}.js`);
builders.push(
await esbuild.build({
entryPoints: [path],
outfile: path,
entryPoints: [entrypoint],
outfile: entrypoint,
bundle: true,
allowOverwrite: true,
format,
Expand All @@ -118,13 +119,18 @@ export const buildTask = task({
switch (name) {
case 'rxjs':
license = await readFile(
`${dirname(require.resolve('rxjs'))}/../../LICENSE.txt`,
path.join(
path.dirname(require.resolve('rxjs')),
'..',
'..',
'LICENSE.txt'
),
'utf-8'
);
break;
case 'mitt':
license = await readFile(
`${dirname(require.resolve('mitt'))}/../LICENSE`,
path.join(path.dirname(require.resolve('mitt')), '..', 'LICENSE'),
'utf-8'
);
break;
Expand Down

0 comments on commit b06c257

Please sign in to comment.