chore: fix build/packaging for recorder and traceviewer (#5338)
This commit is contained in:
parent
d3cc1d7648
commit
983e04374a
|
|
@ -8,9 +8,13 @@
|
||||||
|
|
||||||
# Include sources from lib, but not map files.
|
# Include sources from lib, but not map files.
|
||||||
!lib/**/*.js
|
!lib/**/*.js
|
||||||
|
# Include web assets for recorder, trace viewer, etc.
|
||||||
|
!lib/**/*.html
|
||||||
|
!lib/**/*.png
|
||||||
|
!lib/**/*.ttf
|
||||||
# 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/server/injected/
|
lib/**/injected/
|
||||||
# Include all binaries that we ship with the package.
|
# Include all binaries that we ship with the package.
|
||||||
!bin/*
|
!bin/*
|
||||||
# Include FFMPEG
|
# Include FFMPEG
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module.exports = {
|
||||||
library: 'pwExport',
|
library: 'pwExport',
|
||||||
libraryExport: 'default',
|
libraryExport: 'default',
|
||||||
filename: 'consoleApiSource.js',
|
filename: 'consoleApiSource.js',
|
||||||
path: path.resolve(__dirname, '../../../lib/server/injected/packed')
|
path: path.resolve(__dirname, '../../../../lib/server/injected/packed')
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'consoleApiSource.ts')),
|
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'consoleApiSource.ts')),
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module.exports = {
|
||||||
library: 'pwExport',
|
library: 'pwExport',
|
||||||
libraryExport: 'default',
|
libraryExport: 'default',
|
||||||
filename: 'recorderSource.js',
|
filename: 'recorderSource.js',
|
||||||
path: path.resolve(__dirname, '../../../lib/server/injected/packed')
|
path: path.resolve(__dirname, '../../../../lib/server/injected/packed')
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'recorderSource.ts')),
|
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'recorderSource.ts')),
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ export class RecorderApp extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _init() {
|
private async _init() {
|
||||||
const icon = await readFileAsync(require.resolve('../../../../lib/web/recorder/app_icon.png'));
|
const icon = await readFileAsync(require.resolve('../../../web/recorder/app_icon.png'));
|
||||||
const crPopup = this._page._delegate as CRPage;
|
const crPopup = this._page._delegate as CRPage;
|
||||||
await crPopup._mainFrameSession._client.send('Browser.setDockTile', {
|
await crPopup._mainFrameSession._client.send('Browser.setDockTile', {
|
||||||
image: icon.toString('base64')
|
image: icon.toString('base64')
|
||||||
|
|
@ -65,7 +65,7 @@ export class RecorderApp extends EventEmitter {
|
||||||
await this._page._setServerRequestInterceptor(async route => {
|
await this._page._setServerRequestInterceptor(async route => {
|
||||||
if (route.request().url().startsWith('https://playwright/')) {
|
if (route.request().url().startsWith('https://playwright/')) {
|
||||||
const uri = route.request().url().substring('https://playwright/'.length);
|
const uri = route.request().url().substring('https://playwright/'.length);
|
||||||
const file = require.resolve('../../../../lib/web/recorder/' + uri);
|
const file = require.resolve('../../../web/recorder/' + uri);
|
||||||
const buffer = await readFileAsync(file);
|
const buffer = await readFileAsync(file);
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@
|
||||||
},
|
},
|
||||||
"compileOnSave": true,
|
"compileOnSave": true,
|
||||||
"include": ["src/**/*.ts", "src/**/*.js"],
|
"include": ["src/**/*.ts", "src/**/*.js"],
|
||||||
"exclude": ["node_modules", "src/.eslintrc.js", "src/cli/traceViewer/web/**"]
|
"exclude": ["node_modules", "src/.eslintrc.js", "src/web/**", "src/**/*webpack.config.js"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ onChanges.push({
|
||||||
// Copy images.
|
// Copy images.
|
||||||
steps.push({
|
steps.push({
|
||||||
command: process.platform === 'win32' ? 'copy' : 'cp',
|
command: process.platform === 'win32' ? 'copy' : 'cp',
|
||||||
args: ['src/web/recorder/*.png'.replace(/\//g, path.sep), 'lib/web/recorder/'.replace(/\//g, path.sep)],
|
args: [filePath('src/web/recorder/*.png'), filePath('lib/web/recorder/')],
|
||||||
shell: true,
|
shell: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue