chore: move pw-core utilsBundleImpl into own directory (#23706)
https://github.com/microsoft/playwright/issues/23666
This commit is contained in:
parent
bad09acb87
commit
8ed956e496
|
|
@ -9,7 +9,7 @@
|
||||||
!lib/**/*.html
|
!lib/**/*.html
|
||||||
!lib/**/*.png
|
!lib/**/*.png
|
||||||
!lib/**/*.ttf
|
!lib/**/*.ttf
|
||||||
!lib/xdg-open
|
!lib/utilsBundleImpl/xdg-open
|
||||||
# Exclude injected files. A preprocessed version of these is included via lib/generated.
|
# Exclude injected files. A preprocessed version of these is included via lib/generated.
|
||||||
# See src/server/injected/README.md.
|
# See src/server/injected/README.md.
|
||||||
lib/**/injected/
|
lib/**/injected/
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,20 @@ const path = require('path');
|
||||||
const esbuild = require('esbuild');
|
const esbuild = require('esbuild');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const outdir = path.join(__dirname, '../../lib/utilsBundleImpl');
|
||||||
|
|
||||||
|
if (!fs.existsSync(outdir))
|
||||||
|
fs.mkdirSync(outdir);
|
||||||
|
|
||||||
{
|
{
|
||||||
// 'open' package requires 'xdg-open' script to be present, which does not get bundled by esbuild.
|
// 'open' package requires 'xdg-open' binary 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'));
|
fs.copyFileSync(path.join(__dirname, 'node_modules/open/xdg-open'), path.join(outdir, 'xdg-open'));
|
||||||
}
|
}
|
||||||
|
|
||||||
esbuild.build({
|
esbuild.build({
|
||||||
entryPoints: [path.join(__dirname, 'src/utilsBundleImpl.ts')],
|
entryPoints: [path.join(__dirname, 'src/utilsBundleImpl.ts')],
|
||||||
bundle: true,
|
bundle: true,
|
||||||
outdir: path.join(__dirname, '../../lib'),
|
outfile: path.join(outdir, 'index.js'),
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
target: 'ES2019',
|
target: 'ES2019',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue