File tree Expand file tree Collapse file tree 5 files changed +267095
-10
lines changed Expand file tree Collapse file tree 5 files changed +267095
-10
lines changed Original file line number Diff line number Diff line change 1
1
import type { GatsbyConfig } from "gatsby"
2
- import { RelativeCiAgentWebpackPlugin } from "@relative-ci/agent"
3
-
4
- exports . onCreateWebpackConfig = ( { stage, actions } ) => {
5
- if ( stage === "build-javascript" ) {
6
- actions . setWebpackConfig ( {
7
- plugins : [ new RelativeCiAgentWebpackPlugin ( ) ] ,
8
- } )
9
- }
10
- }
11
2
12
3
const config : GatsbyConfig = {
13
4
siteMetadata : {
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ require("dotenv").config({
12
12
path : `.env.${ process . env . NODE_ENV } ` ,
13
13
} )
14
14
15
+ import { RelativeCiAgentWebpackPlugin } from "@relative-ci/agent"
16
+ import { StatsWriterPlugin } from "webpack-stats-plugin"
17
+
15
18
export const createSchemaCustomization : GatsbyNode [ "createSchemaCustomization" ] =
16
19
async ( { actions } ) => {
17
20
const gql = String . raw
@@ -537,12 +540,27 @@ export const createPages: GatsbyNode["createPages"] = async ({
537
540
}
538
541
539
542
export const onCreateWebpackConfig : GatsbyNode [ "onCreateWebpackConfig" ] =
540
- async ( { actions } ) => {
543
+ async ( { actions, stage } ) => {
541
544
actions . setWebpackConfig ( {
542
545
resolve : {
543
546
fallback : {
544
547
assert : "assert/" ,
545
548
} ,
546
549
} ,
547
550
} )
551
+ if ( stage === "build-javascript" ) {
552
+ actions . setWebpackConfig ( {
553
+ plugins : [
554
+ new RelativeCiAgentWebpackPlugin ( ) ,
555
+ new StatsWriterPlugin ( {
556
+ filename : "../webpack-stats.json" ,
557
+ stats : {
558
+ assets : true ,
559
+ chunks : true ,
560
+ modules : true ,
561
+ } ,
562
+ } ) ,
563
+ ] ,
564
+ } )
565
+ }
548
566
}
Original file line number Diff line number Diff line change 57
57
"timeago.js" : " 4.0.2"
58
58
},
59
59
"devDependencies" : {
60
+ "webpack-stats-plugin" : " 1.1.3" ,
60
61
"@relative-ci/agent" : " 4.2.8" ,
61
62
"@svgr/webpack" : " ^8.0.0" ,
62
63
"@tailwindcss/typography" : " 0.5.9" ,
You can’t perform that action at this time.
0 commit comments