Skip to content

Commit

Permalink
cherry-pick(#23710): chore: bundle open's xdg-open script (#23714)
Browse files Browse the repository at this point in the history
Cherry-pick:
60de830
PR: #23710

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mxschmitt and github-actions[bot] committed Jun 14, 2023
1 parent 182a71f commit ed09eb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/playwright-core/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!lib/**/*.html
!lib/**/*.png
!lib/**/*.ttf
!lib/xdg-open
# Exclude injected files. A preprocessed version of these is included via lib/generated.
# See src/server/injected/README.md.
lib/**/injected/
Expand Down
6 changes: 6 additions & 0 deletions packages/playwright-core/bundles/utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
// @ts-check
const path = require('path');
const esbuild = require('esbuild');
const fs = require('fs');

{
// 'open' package requires 'xdg-open' script to be present, which does not get bundled by esbuild.
fs.copyFileSync(path.join(__dirname, 'node_modules/open/xdg-open'), path.join(__dirname, '../../lib/xdg-open'));
}

esbuild.build({
entryPoints: [path.join(__dirname, 'src/utilsBundleImpl.ts')],
Expand Down

0 comments on commit ed09eb6

Please sign in to comment.