File tree Expand file tree Collapse file tree 4 files changed +251
-43
lines changed
Expand file tree Collapse file tree 4 files changed +251
-43
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ jobs:
104104 NODE_OPTIONS : ' --max_old_space_size=4096'
105105 # Used for API requests that require GitHub API scopes
106106 NEXT_GITHUB_API_KEY : ${{ secrets.GITHUB_TOKEN }}
107+ # Codecov
108+ ANALYZE : ${{ matrix.os == 'ubuntu-latest' && github.event_name != 'merge_group' }}
107109
108110 - name : Build Next.js (Static All Locales)
109111 # We only run full static builds within Pull Requests. This step is also used to export
Original file line number Diff line number Diff line change 11'use strict' ;
2+ import { codecovNextJSWebpackPlugin } from '@codecov/nextjs-webpack-plugin' ;
23import createNextIntlPlugin from 'next-intl/plugin' ;
34
45import { BASE_PATH , ENABLE_STATIC_EXPORT } from './next.constants.mjs' ;
@@ -96,6 +97,23 @@ const nextConfig = {
9697 'shiki' ,
9798 ] ,
9899 } ,
100+ webpack : ( config , options ) => {
101+ if ( process . env . ANALYZE ) {
102+ config . plugins . push (
103+ codecovNextJSWebpackPlugin ( {
104+ enableBundleAnalysis : true ,
105+ // If CODECOV_TOKEN isn't specified, a tokenless
106+ // upload will work as well.
107+ uploadToken : process . env . CODECOV_TOKEN ,
108+ bundleName : '@node-core/website' ,
109+ webpack : options . webpack ,
110+ telemetry : false ,
111+ } )
112+ ) ;
113+ }
114+
115+ return config ;
116+ } ,
99117} ;
100118
101119const withNextIntl = createNextIntlPlugin ( './i18n.tsx' ) ;
Original file line number Diff line number Diff line change 7474 "vfile-matter" : " ~5.0.1"
7575 },
7676 "devDependencies" : {
77+ "@codecov/nextjs-webpack-plugin" : " ^1.9.1" ,
7778 "@eslint/compat" : " ~1.2.8" ,
7879 "@eslint/eslintrc" : " ~3.3.1" ,
7980 "@flarelabs-net/wrangler-build-time-fs-assets-polyfilling" : " ^0.0.0" ,
You can’t perform that action at this time.
0 commit comments