-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathstats-config.js
90 lines (88 loc) · 2.63 KB
/
stats-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
const clientGlobs = [
{
name: 'Client Bundles (main, webpack, commons)',
globs: ['.next/static/runtime/+(main|webpack)-*', '.next/static/chunks/!(polyfills*)'],
},
{
name: 'Legacy Client Bundles (polyfills)',
globs: ['.next/static/chunks/+(polyfills)-*'],
},
{
name: 'Client Pages',
globs: ['.next/static/*/pages/**/*'],
},
{
name: 'Client Build Manifests',
globs: ['.next/static/*/_buildManifest*'],
},
{
name: 'Rendered Page Sizes',
globs: ['fetched-pages/**/*.html'],
},
];
const renames = [
{
srcGlob: '.next/static/*/pages',
dest: '.next/static/BUILD_ID/pages',
},
{
srcGlob: '.next/static/runtime/main-*',
dest: '.next/static/runtime/main-HASH.js',
},
{
srcGlob: '.next/static/runtime/webpack-*',
dest: '.next/static/runtime/webpack-HASH.js',
},
{
srcGlob: '.next/static/runtime/polyfills-*',
dest: '.next/static/runtime/polyfills-HASH.js',
},
{
srcGlob: '.next/static/chunks/commons*',
dest: '.next/static/chunks/commons.HASH.js',
},
{
srcGlob: '.next/static/chunks/framework*',
dest: '.next/static/chunks/framework.HASH.js',
},
// misc
{
srcGlob: '.next/static/*/_buildManifest.js',
dest: '.next/static/BUILD_ID/_buildManifest.js',
},
];
module.exports = {
// the Heading to show at the top of stats comments
commentHeading: 'Stats from current PR',
commentReleaseHeading: 'Stats from current release',
// the command to build the app (app source should be in `.stats-app`)
appBuildCommand: 'cp .env-sample .env && NEXT_TELEMETRY_DISABLED=1 pnpm next build',
appStartCommand: 'NEXT_TELEMETRY_DISABLED=1 pnpm next start --port $PORT',
// the main branch to compare against (what PRs will be merging into)
mainBranch: 'develop',
// the main repository path (relative to https://github.com/)
mainRepo: 'typeofweb/polskifrontend',
// whether to attempt auto merging the main branch into PR before running stats
autoMergeMain: false,
// an array of configs for each run
configs: [
{
// first run's config
// title of the run
title: 'App',
// whether to diff the outputted files (default: onOutputChange)
diff: 'onOutputChange',
// renames to apply to make file names deterministic
renames,
// an array of file groups to diff/track
filesToTrack: clientGlobs,
// an array of URLs to fetch while `appStartCommand` is running
// will be output to fetched-pages/${pathname}.html
pagesToFetch: [
'http://localhost:$PORT/',
'http://localhost:$PORT/list',
'http://localhost:$PORT/zglos-serwis',
],
},
],
};