chore: fix build/packaging for recorder and traceviewer (#5338)

This commit is contained in:
Dmitry Gozman 2021-02-05 16:19:09 -08:00 committed by GitHub
parent d3cc1d7648
commit 983e04374a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 7 deletions

View File

@ -8,9 +8,13 @@
# Include sources from lib, but not map files.
!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.
# See src/server/injected/README.md.
lib/server/injected/
lib/**/injected/
# Include all binaries that we ship with the package.
!bin/*
# Include FFMPEG

View File

@ -42,7 +42,7 @@ module.exports = {
library: 'pwExport',
libraryExport: 'default',
filename: 'consoleApiSource.js',
path: path.resolve(__dirname, '../../../lib/server/injected/packed')
path: path.resolve(__dirname, '../../../../lib/server/injected/packed')
},
plugins: [
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'consoleApiSource.ts')),

View File

@ -42,7 +42,7 @@ module.exports = {
library: 'pwExport',
libraryExport: 'default',
filename: 'recorderSource.js',
path: path.resolve(__dirname, '../../../lib/server/injected/packed')
path: path.resolve(__dirname, '../../../../lib/server/injected/packed')
},
plugins: [
new InlineSource(path.join(__dirname, '..', '..', '..', 'generated', 'recorderSource.ts')),

View File

@ -56,7 +56,7 @@ export class RecorderApp extends EventEmitter {
}
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;
await crPopup._mainFrameSession._client.send('Browser.setDockTile', {
image: icon.toString('base64')
@ -65,7 +65,7 @@ export class RecorderApp extends EventEmitter {
await this._page._setServerRequestInterceptor(async route => {
if (route.request().url().startsWith('https://playwright/')) {
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);
await route.fulfill({
status: 200,

View File

@ -13,5 +13,5 @@
},
"compileOnSave": true,
"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"]
}

View File

@ -125,7 +125,7 @@ onChanges.push({
// Copy images.
steps.push({
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,
});