11// https://www.netlify.com/docs/headers-and-basic-auth/ 
2- 
3- import  {  promises  as  fs  }  from  'fs' 
42import  {  join  }  from  'path' 
53
4+ import  {  writeFile  }  from  'fs-extra' 
65import  {  generatePageDataPath  }  from  'gatsby-core-utils' 
76import  WebpackAssetsManifest  from  'webpack-assets-manifest' 
87
@@ -14,9 +13,7 @@ import makePluginData from './plugin-data'
1413const  assetsManifest  =  { } 
1514
1615/** @type  {import("gatsby").GatsbyNode["pluginOptionsSchema"] } */ 
17- export  const  pluginOptionsSchema  =  ( { 
18-   Joi
19- } : any )  =>  { 
16+ export  const  pluginOptionsSchema  =  ( {  Joi } : any )  =>  { 
2017  const  MATCH_ALL_KEYS  =  / ^ / 
2118
2219  // headers is a specific type used by Netlify: https://www.gatsbyjs.com/plugins/gatsby-plugin-netlify/#headers 
@@ -44,10 +41,7 @@ export const pluginOptionsSchema = ({
4441// Inject a webpack plugin to get the file manifests so we can translate all link headers 
4542/** @type  {import("gatsby").GatsbyNode["onCreateWebpackConfig"] } */ 
4643
47- export  const  onCreateWebpackConfig  =  ( { 
48-   actions, 
49-   stage
50- } : any )  =>  { 
44+ export  const  onCreateWebpackConfig  =  ( {  actions,  stage } : any )  =>  { 
5145  if  ( stage  !==  BUILD_HTML_STAGE  &&  stage  !==  BUILD_CSS_STAGE )  { 
5246    return 
5347  } 
@@ -63,11 +57,7 @@ export const onCreateWebpackConfig = ({
6357} 
6458
6559/** @type  {import("gatsby").GatsbyNode["onPostBuild"] } */ 
66- export  const  onPostBuild  =  async  ( { 
67-   store, 
68-   pathPrefix, 
69-   reporter
70- } : any ,  userPluginOptions : any )  =>  { 
60+ export  const  onPostBuild  =  async  ( {  store,  pathPrefix,  reporter } : any ,  userPluginOptions : any )  =>  { 
7161  const  pluginData  =  makePluginData ( store ,  assetsManifest ,  pathPrefix ) 
7262  const  pluginOptions  =  {  ...DEFAULT_OPTIONS ,  ...userPluginOptions  } 
7363
@@ -113,7 +103,7 @@ export const onPostBuild = async ({
113103
114104  if  ( ! needsFunctions )  { 
115105    reporter . info ( `[gatsby-plugin-netlify] No Netlify functions needed. Skipping...` ) 
116-     await  fs . writeFile ( join ( program . directory ,  `.cache` ,  `.nf-skip-gatsby-functions` ) ,  `` ) 
106+     await  writeFile ( join ( program . directory ,  `.cache` ,  `.nf-skip-gatsby-functions` ) ,  `` ) 
117107  } 
118108
119109  await  Promise . all ( [ 
0 commit comments