gatsby 4.25.2 → 4.25.4-alpha-initial-webhook-body.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,11 @@ import { Store, AnyAction } from "redux";
2
2
  import * as WorkerPool from "../utils/worker/pool";
3
3
  import { IGatsbyState } from "../redux/types";
4
4
  import { IBuildContext } from "./types";
5
+ import type { IDataLayerContext } from "./../state-machines/data-layer/types";
6
+ declare type WebhookBody = IDataLayerContext["webhookBody"];
5
7
  export declare function initialize({ program: args, parentSpan, }: IBuildContext): Promise<{
6
8
  store: Store<IGatsbyState, AnyAction>;
7
9
  workerPool: WorkerPool.GatsbyWorkerPool;
10
+ webhookBody?: WebhookBody;
8
11
  }>;
12
+ export {};
@@ -586,9 +586,20 @@ async function initialize({
586
586
  }
587
587
  }
588
588
 
589
+ let initialWebhookBody = undefined;
590
+
591
+ if (process.env.GATSBY_INITIAL_WEBHOOK_BODY) {
592
+ try {
593
+ initialWebhookBody = JSON.parse(process.env.GATSBY_INITIAL_WEBHOOK_BODY);
594
+ } catch (e) {
595
+ _reporter.default.error(`Failed to parse GATSBY_INITIAL_WEBHOOK_BODY as JSON:\n"${e.message}"`);
596
+ }
597
+ }
598
+
589
599
  return {
590
600
  store: _redux.store,
591
- workerPool
601
+ workerPool,
602
+ webhookBody: initialWebhookBody
592
603
  };
593
604
  }
594
605
  //# sourceMappingURL=initialize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","names":["process","env","gatsby_executing_command","GATSBY_EXPERIMENTAL_FAST_DEV","isCI","GATSBY_WORKER_POOL_WORKER","GATSBY_EXPERIMENTAL_DEV_SSR","PRESERVE_FILE_DOWNLOAD_CACHE","PRESERVE_WEBPACK_CACHE","reporter","info","telemetry","trackFeatureIsUsed","on","reason","panic","initialize","program","args","parentSpan","GATSBY_DISABLE_CACHE_PERSISTENCE","setStore","store","_registerAdditionalDiagnosticOutputHandler","logPendingJobs","outputs","job","getState","jobsV2","incomplete","push","length","size","JSON","stringify","directory","slash","extensions","browserslist","getBrowsersList","dispatch","type","payload","activityForJobs","emitter","phantomActivity","start","onEndJob","jobs","active","end","siteDirectory","activity","activityTimer","compileGatsbyFiles","config","loadConfig","processFlags","flattenedPlugins","loadPlugins","GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND","GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR","lmdbStoreIsUsed","detectLmdbStore","GATSBY_DETECT_NODE_MUTATIONS","enableNodeMutationsDetection","polyfill","warn","CYPRESS_SUPPORT","verbose","removeStaleJobs","pluginsStr","map","p","name","version","decorateEvent","plugins","startPluginRunner","apiRunnerNode","span","lmdbCacheDirectoryName","cacheDirectory","publicDirectory","workerCacheDirectory","lmdbCacheDirectory","cacheJsonDirExists","fs","existsSync","publicDirExists","workerCacheDirExists","lmdbCacheDirExists","cacheDirExists","NODE_ENV","files","glob","cwd","Promise","all","file","remove","GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING","catch","emptyDir","pluginVersions","require","optionalFiles","state","hashes","md5File","trailingSlash","concat","f","pluginsHash","crypto","createHash","update","digest","oldPluginsHash","status","PLUGINS_HASH","stripIndent","cacheIsCorrupt","deleteGlobs","GATSBY_EXPERIMENTAL_PRESERVE_FILE_DOWNLOAD_CACHE","GATSBY_EXPERIMENTAL_PRESERVE_WEBPACK_CACHE","e","error","releaseAllMutexes","pluginCachesPurged","ensureDir","srcDir","__dirname","siteDir","tryRequire","copy","overwrite","err","hasAPIFile","plugin","skipSSR","undefined","envAPIs","modulePath","path","join","resolve","resolveModule","Array","isArray","isResolved","isResolvedSSR","ssrPlugins","options","pluginOptions","filter","browserPlugins","browserPluginsRequires","relativePluginPath","relative","browserAPIRunner","sSRAPIRunner","readFileSync","ssrPluginsRequires","writeFileSync","apiResults","traceId","workerPool","WorkerPool","create","graphqlTypegen","writeGraphQLConfig"],"sources":["../../src/services/initialize.ts"],"sourcesContent":["import _ from \"lodash\"\nimport { slash, isCI } from \"gatsby-core-utils\"\nimport * as fs from \"fs-extra\"\nimport { releaseAllMutexes } from \"gatsby-core-utils/mutex\"\nimport md5File from \"md5-file\"\nimport crypto from \"crypto\"\nimport path from \"path\"\nimport telemetry from \"gatsby-telemetry\"\nimport glob from \"globby\"\n\nimport apiRunnerNode from \"../utils/api-runner-node\"\nimport { getBrowsersList } from \"../utils/browserslist\"\nimport { Store, AnyAction } from \"redux\"\nimport * as WorkerPool from \"../utils/worker/pool\"\nimport { startPluginRunner } from \"../redux/plugin-runner\"\nimport { store, emitter } from \"../redux\"\nimport reporter from \"gatsby-cli/lib/reporter\"\nimport { removeStaleJobs } from \"../bootstrap/remove-stale-jobs\"\nimport { IPluginInfoOptions } from \"../bootstrap/load-plugins/types\"\nimport { IGatsbyState, IStateProgram } from \"../redux/types\"\nimport { IBuildContext } from \"./types\"\nimport { detectLmdbStore } from \"../datastore\"\nimport { loadConfig } from \"../bootstrap/load-config\"\nimport { loadPlugins } from \"../bootstrap/load-plugins\"\nimport type { InternalJob } from \"../utils/jobs/types\"\nimport { enableNodeMutationsDetection } from \"../utils/detect-node-mutations\"\nimport { compileGatsbyFiles } from \"../utils/parcel/compile-gatsby-files\"\nimport { resolveModule } from \"../utils/module-resolver\"\nimport { writeGraphQLConfig } from \"../utils/graphql-typegen/file-writes\"\n\ninterface IPluginResolution {\n resolve: string\n options: IPluginInfoOptions\n}\n\ninterface IPluginResolutionSSR extends IPluginResolution {\n name: string\n}\n\n// If the env variable GATSBY_EXPERIMENTAL_FAST_DEV is set, enable\n// all DEV experimental changes (but only during development & not on CI).\nif (\n process.env.gatsby_executing_command === `develop` &&\n process.env.GATSBY_EXPERIMENTAL_FAST_DEV &&\n !isCI() &&\n // skip FAST_DEV handling in workers, all env vars will be handle\n // by main process already and passed to worker\n !process.env.GATSBY_WORKER_POOL_WORKER\n) {\n process.env.GATSBY_EXPERIMENTAL_DEV_SSR = `true`\n process.env.PRESERVE_FILE_DOWNLOAD_CACHE = `true`\n process.env.PRESERVE_WEBPACK_CACHE = `true`\n\n reporter.info(`\nThree fast dev experiments are enabled: Development SSR, preserving file download cache and preserving webpack cache.\n\nPlease give feedback on their respective umbrella issues!\n\n- https://gatsby.dev/dev-ssr-feedback\n- https://gatsby.dev/cache-clearing-feedback\n `)\n\n telemetry.trackFeatureIsUsed(`FastDev`)\n}\n\n// Show stack trace on unhandled promises.\nprocess.on(`unhandledRejection`, (reason: unknown) => {\n // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33636\n reporter.panic((reason as Error) || `Unhandled rejection`)\n})\n\n// Override console.log to add the source file + line number.\n// Useful for debugging if you lose a console.log somewhere.\n// Otherwise leave commented out.\n// require(`../bootstrap/log-line-function`)\n\nexport async function initialize({\n program: args,\n parentSpan,\n}: IBuildContext): Promise<{\n store: Store<IGatsbyState, AnyAction>\n workerPool: WorkerPool.GatsbyWorkerPool\n}> {\n if (process.env.GATSBY_DISABLE_CACHE_PERSISTENCE) {\n reporter.info(\n `GATSBY_DISABLE_CACHE_PERSISTENCE is enabled. Cache won't be persisted. Next builds will not be able to reuse any work done by current session.`\n )\n telemetry.trackFeatureIsUsed(`DisableCachePersistence`)\n }\n if (!args) {\n reporter.panic(`Missing program args`)\n }\n\n /* Time for a little story...\n * When running `gatsby develop`, the globally installed gatsby-cli starts\n * and sets up a Redux store (which is where logs are now stored). When gatsby\n * finds your project's locally installed gatsby-cli package in node_modules,\n * it switches over. This instance will have a separate redux store. We need to\n * ensure that the correct store is used which is why we call setStore\n * (/packages/gatsby-cli/src/reporter/redux/index.js)\n *\n * This function\n * - copies over the logs from the global gatsby-cli to the local one\n * - sets the store to the local one (so that further actions dispatched by\n * the global gatsby-cli are handled by the local one)\n */\n if (args.setStore) {\n args.setStore(store)\n }\n\n if (reporter._registerAdditionalDiagnosticOutputHandler) {\n reporter._registerAdditionalDiagnosticOutputHandler(\n function logPendingJobs(): string {\n const outputs: Array<InternalJob> = []\n\n for (const [, { job }] of store.getState().jobsV2.incomplete) {\n outputs.push(job)\n if (outputs.length >= 5) {\n // 5 not finished jobs should be enough to track down issues\n // this is just limiting output \"spam\"\n break\n }\n }\n\n return outputs.length\n ? `Unfinished jobs (showing ${outputs.length} of ${\n store.getState().jobsV2.incomplete.size\n } jobs total):\\n\\n` + JSON.stringify(outputs, null, 2)\n : ``\n }\n )\n }\n\n const directory = slash(args.directory)\n\n const program: IStateProgram = {\n ...args,\n extensions: [],\n browserslist: getBrowsersList(directory),\n // Fix program directory path for windows env.\n directory,\n }\n\n store.dispatch({\n type: `SET_PROGRAM`,\n payload: program,\n })\n\n let activityForJobs\n\n emitter.on(`CREATE_JOB`, () => {\n if (!activityForJobs) {\n activityForJobs = reporter.phantomActivity(`Running jobs`)\n activityForJobs.start()\n }\n })\n\n const onEndJob = (): void => {\n if (activityForJobs && store.getState().jobs.active.length === 0) {\n activityForJobs.end()\n activityForJobs = null\n }\n }\n\n emitter.on(`END_JOB`, onEndJob)\n\n const siteDirectory = program.directory\n\n // Compile root gatsby files\n let activity = reporter.activityTimer(`compile gatsby files`)\n activity.start()\n await compileGatsbyFiles(siteDirectory)\n activity.end()\n\n // Load gatsby config\n activity = reporter.activityTimer(`load gatsby config`, {\n parentSpan,\n })\n activity.start()\n const config = await loadConfig({\n siteDirectory,\n processFlags: true,\n })\n activity.end()\n\n // Load plugins\n activity = reporter.activityTimer(`load plugins`, {\n parentSpan,\n })\n activity.start()\n const flattenedPlugins = await loadPlugins(config, siteDirectory)\n activity.end()\n\n // TODO: figure out proper way of disabling loading indicator\n // for now GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR=false gatsby develop\n // will work, but we don't want to force users into using env vars\n if (\n process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&\n !process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR\n ) {\n // if query on demand is enabled and GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR was not set at all\n // enable loading indicator\n process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR = `true`\n }\n const lmdbStoreIsUsed = detectLmdbStore()\n\n if (process.env.GATSBY_DETECT_NODE_MUTATIONS) {\n enableNodeMutationsDetection()\n }\n\n if (config && config.polyfill) {\n reporter.warn(\n `Support for custom Promise polyfills has been removed in Gatsby v2. We only support Babel 7's new automatic polyfilling behavior.`\n )\n }\n\n if (process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND) {\n if (process.env.gatsby_executing_command !== `develop`) {\n // we don't want to ever have this flag enabled for anything than develop\n // in case someone have this env var globally set\n delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND\n } else if (isCI() && !process.env.CYPRESS_SUPPORT) {\n delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND\n reporter.verbose(\n `Experimental Query on Demand feature is not available in CI environment. Continuing with eager query running.`\n )\n }\n }\n\n // run stale jobs\n // @ts-ignore we'll need to fix redux typings https://redux.js.org/usage/usage-with-typescript\n store.dispatch(removeStaleJobs(store.getState().jobsV2))\n\n // Multiple occurrences of the same name-version-pair can occur,\n // so we report an array of unique pairs\n const pluginsStr = _.uniq(flattenedPlugins.map(p => `${p.name}@${p.version}`))\n telemetry.decorateEvent(`BUILD_END`, {\n plugins: pluginsStr,\n })\n\n telemetry.decorateEvent(`DEVELOP_STOP`, {\n plugins: pluginsStr,\n })\n\n // Start plugin runner which listens to the store\n // and invokes Gatsby API based on actions.\n startPluginRunner()\n\n // onPreInit\n activity = reporter.activityTimer(`onPreInit`, {\n parentSpan,\n })\n activity.start()\n await apiRunnerNode(`onPreInit`, { parentSpan: activity.span })\n activity.end()\n\n const lmdbCacheDirectoryName = `caches-lmdb`\n\n const cacheDirectory = `${program.directory}/.cache`\n const publicDirectory = `${program.directory}/public`\n const workerCacheDirectory = `${program.directory}/.cache/worker`\n const lmdbCacheDirectory = `${program.directory}/.cache/${lmdbCacheDirectoryName}`\n\n const cacheJsonDirExists = fs.existsSync(`${cacheDirectory}/json`)\n const publicDirExists = fs.existsSync(publicDirectory)\n const workerCacheDirExists = fs.existsSync(workerCacheDirectory)\n const lmdbCacheDirExists = fs.existsSync(lmdbCacheDirectory)\n\n // check the cache file that is used by the current configuration\n const cacheDirExists = lmdbStoreIsUsed\n ? lmdbCacheDirExists\n : cacheJsonDirExists\n\n // For builds in case public dir exists, but cache doesn't, we need to clean up potentially stale\n // artifacts from previous builds (due to cache not being available, we can't rely on tracking of artifacts)\n if (\n process.env.NODE_ENV === `production` &&\n publicDirExists &&\n !cacheDirExists\n ) {\n activity = reporter.activityTimer(\n `delete html and css files from previous builds`,\n {\n parentSpan,\n }\n )\n activity.start()\n const files = await glob(\n [\n `public/**/*.{html,css}`,\n `!public/page-data/**/*`,\n `!public/static`,\n `!public/static/**/*.{html,css}`,\n ],\n {\n cwd: program.directory,\n }\n )\n await Promise.all(files.map(file => fs.remove(file)))\n activity.end()\n }\n\n // When the main process and workers communicate they save parts of their redux state to .cache/worker\n // We should clean this directory to remove stale files that a worker might accidentally reuse then\n if (\n workerCacheDirExists &&\n process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING\n ) {\n activity = reporter.activityTimer(\n `delete worker cache from previous builds`,\n {\n parentSpan,\n }\n )\n activity.start()\n await fs\n .remove(workerCacheDirectory)\n .catch(() => fs.emptyDir(workerCacheDirectory))\n activity.end()\n }\n\n activity = reporter.activityTimer(`initialize cache`, {\n parentSpan,\n })\n activity.start()\n // Check if any plugins have been updated since our last run. If so,\n // we delete the cache as there's likely been changes since\n // the previous run.\n //\n // We do this by creating a hash of all the version numbers of installed\n // plugins, the site's package.json, gatsby-config.js, and gatsby-node.js.\n // The last, gatsby-node.js, is important as many gatsby sites put important\n // logic in there e.g. generating slugs for custom pages.\n const pluginVersions = flattenedPlugins.map(p => p.version)\n // we should include gatsby version as well\n pluginVersions.push(require(`../../package.json`).version)\n const optionalFiles = [\n `${program.directory}/gatsby-config.js`,\n `${program.directory}/gatsby-node.js`,\n `${program.directory}/gatsby-config.ts`,\n `${program.directory}/gatsby-node.ts`,\n ] as Array<string>\n\n const state = store.getState()\n\n const hashes = await Promise.all(\n // Ignore optional files with .catch() as these are not required\n [md5File(`package.json`), state.config.trailingSlash as string].concat(\n optionalFiles.map(f => md5File(f).catch(() => ``))\n )\n )\n\n const pluginsHash = crypto\n .createHash(`md5`)\n .update(JSON.stringify(pluginVersions.concat(hashes)))\n .digest(`hex`)\n\n const oldPluginsHash = state && state.status ? state.status.PLUGINS_HASH : ``\n\n // Check if anything has changed. If it has, delete the site's .cache\n // directory and tell reducers to empty themselves.\n //\n // Also if the hash isn't there, then delete things just in case something\n // is weird.\n if (oldPluginsHash && pluginsHash !== oldPluginsHash) {\n reporter.info(reporter.stripIndent`\n One or more of your plugins have changed since the last time you ran Gatsby. As\n a precaution, we're deleting your site's cache to ensure there's no stale data.\n `)\n }\n\n // .cache directory exists in develop at this point\n // so checking for .cache/json or .cache/caches-lmdb as a heuristic (could be any expected file)\n const cacheIsCorrupt = cacheDirExists && !publicDirExists\n if (cacheIsCorrupt) {\n reporter.info(reporter.stripIndent`\n We've detected that the Gatsby cache is incomplete (the .cache directory exists\n but the public directory does not). As a precaution, we're deleting your site's\n cache to ensure there's no stale data.\n `)\n }\n\n if (!oldPluginsHash || pluginsHash !== oldPluginsHash || cacheIsCorrupt) {\n try {\n // Comment out inviet until we can test perf impact\n //\n // let sourceFileSystemVersion = flattenedPlugins.find(\n // plugin => plugin.name === `gatsby-source-filesystem`\n // )?.version\n\n // // The site might be using a plugin which uses \"createRemoteFileNode\" but\n // // doesn't have gatsby-source-filesystem in their gatsby-config.js. So lets\n // // also try requiring it.\n // if (!sourceFileSystemVersion) {\n // try {\n // sourceFileSystemVersion = require(`gatsby-source-filesystem/package.json`)\n // ?.version\n // } catch {\n // // ignore require errors\n // }\n // }\n // } else if (\n // sourceFileSystemVersion &&\n // semver.lt(sourceFileSystemVersion, `2.9.0`)\n // ) {\n // // If the site has more than 50 downloaded files in it, tell them\n // // how to save time.\n // try {\n // // Divide by two as the directory as both cache files + the actual downloaded files so\n // // two results / downloaded file.\n // const filesCount =\n // (await fs.readdir(`.cache/caches/gatsby-source-filesystem`))\n // .length / 2\n // if (filesCount > 50) {\n // reporter.info(stripIndent`\\n\\n\n\n // Your local development experience is about to get better, faster, and stronger!\n\n // Your friendly Gatsby maintainers detected your site downloads quite a few files and that we're about to delete all ${Math.round(\n // filesCount\n // )} of them 😅. We're working right now to make our caching smarter which means we won't delete your downloaded files any more.\n\n // If you're interested in trialing the new caching behavior *today* — which should make your local development environment faster, go ahead and enable the PRESERVE_FILE_DOWNLOAD_CACHE flag and run your develop server again.\n\n // To do so, add to your gatsby-config.js:\n\n // flags: {\n // preserve_file_download_cache: true,\n // }\n\n // visit the umbrella issue to learn more: https://github.com/gatsbyjs/gatsby/discussions/28331\n // `)\n // }\n // } catch {\n // // ignore errors (mostly will just be directory not found).\n // }\n // }\n\n const deleteGlobs = [\n // By default delete all files & subdirectories\n `.cache/**`,\n `.cache/data/**`,\n `!.cache/data/gatsby-core-utils/**`,\n `!.cache/compiled`,\n ]\n\n if (process.env.GATSBY_EXPERIMENTAL_PRESERVE_FILE_DOWNLOAD_CACHE) {\n // Stop the caches directory from being deleted, add all sub directories,\n // but remove gatsby-source-filesystem\n deleteGlobs.push(`!.cache/caches`)\n deleteGlobs.push(`.cache/caches/*`)\n deleteGlobs.push(`!.cache/caches/gatsby-source-filesystem`)\n }\n\n if (process.env.GATSBY_EXPERIMENTAL_PRESERVE_WEBPACK_CACHE) {\n // Add webpack\n deleteGlobs.push(`!.cache/webpack`)\n }\n\n const files = await glob(deleteGlobs, {\n cwd: program.directory,\n })\n\n await Promise.all(files.map(file => fs.remove(file)))\n } catch (e) {\n reporter.error(`Failed to remove .cache files.`, e)\n }\n // Tell reducers to delete their data (the store will already have\n // been loaded from the file system cache).\n store.dispatch({\n type: `DELETE_CACHE`,\n cacheIsCorrupt,\n })\n\n // make sure all previous mutexes are released\n await releaseAllMutexes()\n\n // in future this should show which plugin's caches are purged\n // possibly should also have which plugins had caches\n telemetry.decorateEvent(`BUILD_END`, {\n pluginCachesPurged: [`*`],\n })\n telemetry.decorateEvent(`DEVELOP_STOP`, {\n pluginCachesPurged: [`*`],\n })\n }\n\n // Update the store with the new plugins hash.\n store.dispatch({\n type: `UPDATE_PLUGINS_HASH`,\n payload: pluginsHash,\n })\n\n // Now that we know the .cache directory is safe, initialize the cache\n // directory.\n await fs.ensureDir(cacheDirectory)\n\n // Ensure the public/static directory\n await fs.ensureDir(`${publicDirectory}/static`)\n\n // Init plugins once cache is initialized\n await apiRunnerNode(`onPluginInit`, {\n parentSpan: activity.span,\n })\n\n activity.end()\n\n activity = reporter.activityTimer(`copy gatsby files`, {\n parentSpan,\n })\n activity.start()\n const srcDir = `${__dirname}/../../cache-dir`\n const siteDir = cacheDirectory\n const tryRequire = `${__dirname}/../utils/test-require-error.js`\n try {\n await fs.copy(srcDir, siteDir, {\n overwrite: true,\n })\n await fs.copy(tryRequire, `${siteDir}/test-require-error.js`)\n if (lmdbStoreIsUsed) {\n await fs.ensureDir(`${cacheDirectory}/${lmdbCacheDirectoryName}`)\n } else {\n await fs.ensureDir(`${cacheDirectory}/json`)\n }\n\n // Ensure .cache/fragments exists and is empty. We want fragments to be\n // added on every run in response to data as fragments can only be added if\n // the data used to create the schema they're dependent on is available.\n await fs.emptyDir(`${cacheDirectory}/fragments`)\n } catch (err) {\n reporter.panic(`Unable to copy site files to .cache`, err)\n }\n\n // Find plugins which implement gatsby-browser and gatsby-ssr and write\n // out api-runners for them.\n const hasAPIFile = (env, plugin): string | undefined => {\n // The plugin loader has disabled SSR APIs for this plugin. Usually due to\n // multiple implementations of an API that can only be implemented once\n if (env === `ssr` && plugin.skipSSR === true) return undefined\n\n const envAPIs = plugin[`${env}APIs`]\n\n // Always include gatsby-browser.js files if they exist as they're\n // a handy place to include global styles and other global imports.\n try {\n if (env === `browser`) {\n const modulePath = path.join(plugin.resolve, `gatsby-${env}`)\n return slash(resolveModule(modulePath) as string)\n }\n } catch (e) {\n // ignore\n }\n\n if (envAPIs && Array.isArray(envAPIs) && envAPIs.length > 0) {\n const modulePath = path.join(plugin.resolve, `gatsby-${env}`)\n return slash(resolveModule(modulePath) as string)\n }\n return undefined\n }\n\n const isResolved = (plugin): plugin is IPluginResolution => !!plugin.resolve\n const isResolvedSSR = (plugin): plugin is IPluginResolutionSSR =>\n !!plugin.resolve\n\n const ssrPlugins: Array<IPluginResolutionSSR> = flattenedPlugins\n .map(plugin => {\n return {\n name: plugin.name,\n resolve: hasAPIFile(`ssr`, plugin),\n options: plugin.pluginOptions,\n }\n })\n .filter(isResolvedSSR)\n\n const browserPlugins: Array<IPluginResolution> = flattenedPlugins\n .map(plugin => {\n return {\n resolve: hasAPIFile(`browser`, plugin),\n options: plugin.pluginOptions,\n }\n })\n .filter(isResolved)\n\n const browserPluginsRequires = browserPlugins\n .map(plugin => {\n // we need a relative import path to keep contenthash the same if directory changes\n const relativePluginPath = path.relative(siteDir, plugin.resolve)\n return `{\n plugin: require('${slash(relativePluginPath)}'),\n options: ${JSON.stringify(plugin.options)},\n }`\n })\n .join(`,`)\n\n const browserAPIRunner = `module.exports = [${browserPluginsRequires}]\\n`\n\n let sSRAPIRunner = ``\n\n try {\n sSRAPIRunner = fs.readFileSync(`${siteDir}/api-runner-ssr.js`, `utf-8`)\n } catch (err) {\n reporter.panic(`Failed to read ${siteDir}/api-runner-ssr.js`, err)\n }\n\n const ssrPluginsRequires = ssrPlugins\n .map(\n plugin =>\n `{\n name: '${plugin.name}',\n plugin: require('${plugin.resolve}'),\n options: ${JSON.stringify(plugin.options)},\n }`\n )\n .join(`,`)\n sSRAPIRunner = `var plugins = [${ssrPluginsRequires}]\\n${sSRAPIRunner}`\n\n fs.writeFileSync(\n `${siteDir}/api-runner-browser-plugins.js`,\n browserAPIRunner,\n `utf-8`\n )\n fs.writeFileSync(`${siteDir}/api-runner-ssr.js`, sSRAPIRunner, `utf-8`)\n\n activity.end()\n /**\n * Start the main bootstrap processes.\n */\n\n // onPreBootstrap\n activity = reporter.activityTimer(`onPreBootstrap`, {\n parentSpan,\n })\n activity.start()\n await apiRunnerNode(`onPreBootstrap`, {\n parentSpan: activity.span,\n })\n activity.end()\n\n // Track trailing slash option used in config\n telemetry.trackFeatureIsUsed(`trailingSlash:${state.config.trailingSlash}`)\n\n // Collect resolvable extensions and attach to program.\n const extensions = [`.mjs`, `.js`, `.jsx`, `.wasm`, `.json`]\n // Change to this being an action and plugins implement `onPreBootstrap`\n // for adding extensions.\n const apiResults = await apiRunnerNode(`resolvableExtensions`, {\n traceId: `initial-resolvableExtensions`,\n parentSpan,\n })\n\n store.dispatch({\n type: `SET_PROGRAM_EXTENSIONS`,\n payload: _.flattenDeep([extensions, apiResults]),\n })\n\n const workerPool = WorkerPool.create()\n\n if (state.config.graphqlTypegen) {\n telemetry.trackFeatureIsUsed(`GraphQLTypegen`)\n // This is only run during `gatsby develop`\n if (process.env.gatsby_executing_command === `develop`) {\n writeGraphQLConfig(program)\n }\n }\n\n return {\n store,\n workerPool,\n }\n}\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAWA;AACA;AACA,IACEA,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAA1C,IACAF,OAAO,CAACC,GAAR,CAAYE,4BADZ,IAEA,CAAC,IAAAC,qBAAA,GAFD,IAGA;AACA;AACA,CAACJ,OAAO,CAACC,GAAR,CAAYI,yBANf,EAOE;EACAL,OAAO,CAACC,GAAR,CAAYK,2BAAZ,GAA2C,MAA3C;EACAN,OAAO,CAACC,GAAR,CAAYM,4BAAZ,GAA4C,MAA5C;EACAP,OAAO,CAACC,GAAR,CAAYO,sBAAZ,GAAsC,MAAtC;;EAEAC,iBAAA,CAASC,IAAT,CAAe;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,GAPE;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ACA,MAAMgI,UAAU,GAAG,MAAM,IAAAtF,sBAAA,EAAe,sBAAf,EAAsC;IAC7DuF,OAAO,EAAG,8BADmD;IAE7DnJ;EAF6D,CAAtC,CAAzB;;EAKAG,YAAA,CAAMkB,QAAN,CAAe;IACbC,IAAI,EAAG,wBADM;IAEbC,OAAO,EAAE,2BAAc,CAACL,UAAD,EAAagI,UAAb,CAAd;EAFI,CAAf;;EAKA,MAAME,UAAU,GAAGC,UAAU,CAACC,MAAX,EAAnB;;EAEA,IAAI9D,KAAK,CAACpD,MAAN,CAAamH,cAAjB,EAAiC;IAC/B/J,wBAAA,CAAUC,kBAAV,CAA8B,gBAA9B,EAD+B,CAE/B;;;IACA,IAAIZ,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAA9C,EAAwD;MACtD,IAAAyK,8BAAA,EAAmB1J,OAAnB;IACD;EACF;;EAED,OAAO;IACLK,KAAK,EAALA,YADK;IAELiJ;EAFK,CAAP;AAID"}
1
+ {"version":3,"file":"initialize.js","names":["process","env","gatsby_executing_command","GATSBY_EXPERIMENTAL_FAST_DEV","isCI","GATSBY_WORKER_POOL_WORKER","GATSBY_EXPERIMENTAL_DEV_SSR","PRESERVE_FILE_DOWNLOAD_CACHE","PRESERVE_WEBPACK_CACHE","reporter","info","telemetry","trackFeatureIsUsed","on","reason","panic","initialize","program","args","parentSpan","GATSBY_DISABLE_CACHE_PERSISTENCE","setStore","store","_registerAdditionalDiagnosticOutputHandler","logPendingJobs","outputs","job","getState","jobsV2","incomplete","push","length","size","JSON","stringify","directory","slash","extensions","browserslist","getBrowsersList","dispatch","type","payload","activityForJobs","emitter","phantomActivity","start","onEndJob","jobs","active","end","siteDirectory","activity","activityTimer","compileGatsbyFiles","config","loadConfig","processFlags","flattenedPlugins","loadPlugins","GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND","GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR","lmdbStoreIsUsed","detectLmdbStore","GATSBY_DETECT_NODE_MUTATIONS","enableNodeMutationsDetection","polyfill","warn","CYPRESS_SUPPORT","verbose","removeStaleJobs","pluginsStr","map","p","name","version","decorateEvent","plugins","startPluginRunner","apiRunnerNode","span","lmdbCacheDirectoryName","cacheDirectory","publicDirectory","workerCacheDirectory","lmdbCacheDirectory","cacheJsonDirExists","fs","existsSync","publicDirExists","workerCacheDirExists","lmdbCacheDirExists","cacheDirExists","NODE_ENV","files","glob","cwd","Promise","all","file","remove","GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING","catch","emptyDir","pluginVersions","require","optionalFiles","state","hashes","md5File","trailingSlash","concat","f","pluginsHash","crypto","createHash","update","digest","oldPluginsHash","status","PLUGINS_HASH","stripIndent","cacheIsCorrupt","deleteGlobs","GATSBY_EXPERIMENTAL_PRESERVE_FILE_DOWNLOAD_CACHE","GATSBY_EXPERIMENTAL_PRESERVE_WEBPACK_CACHE","e","error","releaseAllMutexes","pluginCachesPurged","ensureDir","srcDir","__dirname","siteDir","tryRequire","copy","overwrite","err","hasAPIFile","plugin","skipSSR","undefined","envAPIs","modulePath","path","join","resolve","resolveModule","Array","isArray","isResolved","isResolvedSSR","ssrPlugins","options","pluginOptions","filter","browserPlugins","browserPluginsRequires","relativePluginPath","relative","browserAPIRunner","sSRAPIRunner","readFileSync","ssrPluginsRequires","writeFileSync","apiResults","traceId","workerPool","WorkerPool","create","graphqlTypegen","writeGraphQLConfig","initialWebhookBody","GATSBY_INITIAL_WEBHOOK_BODY","parse","message","webhookBody"],"sources":["../../src/services/initialize.ts"],"sourcesContent":["import _ from \"lodash\"\nimport { slash, isCI } from \"gatsby-core-utils\"\nimport * as fs from \"fs-extra\"\nimport { releaseAllMutexes } from \"gatsby-core-utils/mutex\"\nimport md5File from \"md5-file\"\nimport crypto from \"crypto\"\nimport path from \"path\"\nimport telemetry from \"gatsby-telemetry\"\nimport glob from \"globby\"\n\nimport apiRunnerNode from \"../utils/api-runner-node\"\nimport { getBrowsersList } from \"../utils/browserslist\"\nimport { Store, AnyAction } from \"redux\"\nimport * as WorkerPool from \"../utils/worker/pool\"\nimport { startPluginRunner } from \"../redux/plugin-runner\"\nimport { store, emitter } from \"../redux\"\nimport reporter from \"gatsby-cli/lib/reporter\"\nimport { removeStaleJobs } from \"../bootstrap/remove-stale-jobs\"\nimport { IPluginInfoOptions } from \"../bootstrap/load-plugins/types\"\nimport { IGatsbyState, IStateProgram } from \"../redux/types\"\nimport { IBuildContext } from \"./types\"\nimport { detectLmdbStore } from \"../datastore\"\nimport { loadConfig } from \"../bootstrap/load-config\"\nimport { loadPlugins } from \"../bootstrap/load-plugins\"\nimport type { InternalJob } from \"../utils/jobs/types\"\nimport type { IDataLayerContext } from \"./../state-machines/data-layer/types\"\nimport { enableNodeMutationsDetection } from \"../utils/detect-node-mutations\"\nimport { compileGatsbyFiles } from \"../utils/parcel/compile-gatsby-files\"\nimport { resolveModule } from \"../utils/module-resolver\"\nimport { writeGraphQLConfig } from \"../utils/graphql-typegen/file-writes\"\n\ninterface IPluginResolution {\n resolve: string\n options: IPluginInfoOptions\n}\n\ninterface IPluginResolutionSSR extends IPluginResolution {\n name: string\n}\n\n// If the env variable GATSBY_EXPERIMENTAL_FAST_DEV is set, enable\n// all DEV experimental changes (but only during development & not on CI).\nif (\n process.env.gatsby_executing_command === `develop` &&\n process.env.GATSBY_EXPERIMENTAL_FAST_DEV &&\n !isCI() &&\n // skip FAST_DEV handling in workers, all env vars will be handle\n // by main process already and passed to worker\n !process.env.GATSBY_WORKER_POOL_WORKER\n) {\n process.env.GATSBY_EXPERIMENTAL_DEV_SSR = `true`\n process.env.PRESERVE_FILE_DOWNLOAD_CACHE = `true`\n process.env.PRESERVE_WEBPACK_CACHE = `true`\n\n reporter.info(`\nThree fast dev experiments are enabled: Development SSR, preserving file download cache and preserving webpack cache.\n\nPlease give feedback on their respective umbrella issues!\n\n- https://gatsby.dev/dev-ssr-feedback\n- https://gatsby.dev/cache-clearing-feedback\n `)\n\n telemetry.trackFeatureIsUsed(`FastDev`)\n}\n\n// Show stack trace on unhandled promises.\nprocess.on(`unhandledRejection`, (reason: unknown) => {\n // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33636\n reporter.panic((reason as Error) || `Unhandled rejection`)\n})\n\n// Override console.log to add the source file + line number.\n// Useful for debugging if you lose a console.log somewhere.\n// Otherwise leave commented out.\n// require(`../bootstrap/log-line-function`)\n\ntype WebhookBody = IDataLayerContext[\"webhookBody\"]\n\nexport async function initialize({\n program: args,\n parentSpan,\n}: IBuildContext): Promise<{\n store: Store<IGatsbyState, AnyAction>\n workerPool: WorkerPool.GatsbyWorkerPool\n webhookBody?: WebhookBody\n}> {\n if (process.env.GATSBY_DISABLE_CACHE_PERSISTENCE) {\n reporter.info(\n `GATSBY_DISABLE_CACHE_PERSISTENCE is enabled. Cache won't be persisted. Next builds will not be able to reuse any work done by current session.`\n )\n telemetry.trackFeatureIsUsed(`DisableCachePersistence`)\n }\n if (!args) {\n reporter.panic(`Missing program args`)\n }\n\n /* Time for a little story...\n * When running `gatsby develop`, the globally installed gatsby-cli starts\n * and sets up a Redux store (which is where logs are now stored). When gatsby\n * finds your project's locally installed gatsby-cli package in node_modules,\n * it switches over. This instance will have a separate redux store. We need to\n * ensure that the correct store is used which is why we call setStore\n * (/packages/gatsby-cli/src/reporter/redux/index.js)\n *\n * This function\n * - copies over the logs from the global gatsby-cli to the local one\n * - sets the store to the local one (so that further actions dispatched by\n * the global gatsby-cli are handled by the local one)\n */\n if (args.setStore) {\n args.setStore(store)\n }\n\n if (reporter._registerAdditionalDiagnosticOutputHandler) {\n reporter._registerAdditionalDiagnosticOutputHandler(\n function logPendingJobs(): string {\n const outputs: Array<InternalJob> = []\n\n for (const [, { job }] of store.getState().jobsV2.incomplete) {\n outputs.push(job)\n if (outputs.length >= 5) {\n // 5 not finished jobs should be enough to track down issues\n // this is just limiting output \"spam\"\n break\n }\n }\n\n return outputs.length\n ? `Unfinished jobs (showing ${outputs.length} of ${\n store.getState().jobsV2.incomplete.size\n } jobs total):\\n\\n` + JSON.stringify(outputs, null, 2)\n : ``\n }\n )\n }\n\n const directory = slash(args.directory)\n\n const program: IStateProgram = {\n ...args,\n extensions: [],\n browserslist: getBrowsersList(directory),\n // Fix program directory path for windows env.\n directory,\n }\n\n store.dispatch({\n type: `SET_PROGRAM`,\n payload: program,\n })\n\n let activityForJobs\n\n emitter.on(`CREATE_JOB`, () => {\n if (!activityForJobs) {\n activityForJobs = reporter.phantomActivity(`Running jobs`)\n activityForJobs.start()\n }\n })\n\n const onEndJob = (): void => {\n if (activityForJobs && store.getState().jobs.active.length === 0) {\n activityForJobs.end()\n activityForJobs = null\n }\n }\n\n emitter.on(`END_JOB`, onEndJob)\n\n const siteDirectory = program.directory\n\n // Compile root gatsby files\n let activity = reporter.activityTimer(`compile gatsby files`)\n activity.start()\n await compileGatsbyFiles(siteDirectory)\n activity.end()\n\n // Load gatsby config\n activity = reporter.activityTimer(`load gatsby config`, {\n parentSpan,\n })\n activity.start()\n const config = await loadConfig({\n siteDirectory,\n processFlags: true,\n })\n activity.end()\n\n // Load plugins\n activity = reporter.activityTimer(`load plugins`, {\n parentSpan,\n })\n activity.start()\n const flattenedPlugins = await loadPlugins(config, siteDirectory)\n activity.end()\n\n // TODO: figure out proper way of disabling loading indicator\n // for now GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR=false gatsby develop\n // will work, but we don't want to force users into using env vars\n if (\n process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&\n !process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR\n ) {\n // if query on demand is enabled and GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR was not set at all\n // enable loading indicator\n process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR = `true`\n }\n const lmdbStoreIsUsed = detectLmdbStore()\n\n if (process.env.GATSBY_DETECT_NODE_MUTATIONS) {\n enableNodeMutationsDetection()\n }\n\n if (config && config.polyfill) {\n reporter.warn(\n `Support for custom Promise polyfills has been removed in Gatsby v2. We only support Babel 7's new automatic polyfilling behavior.`\n )\n }\n\n if (process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND) {\n if (process.env.gatsby_executing_command !== `develop`) {\n // we don't want to ever have this flag enabled for anything than develop\n // in case someone have this env var globally set\n delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND\n } else if (isCI() && !process.env.CYPRESS_SUPPORT) {\n delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND\n reporter.verbose(\n `Experimental Query on Demand feature is not available in CI environment. Continuing with eager query running.`\n )\n }\n }\n\n // run stale jobs\n // @ts-ignore we'll need to fix redux typings https://redux.js.org/usage/usage-with-typescript\n store.dispatch(removeStaleJobs(store.getState().jobsV2))\n\n // Multiple occurrences of the same name-version-pair can occur,\n // so we report an array of unique pairs\n const pluginsStr = _.uniq(flattenedPlugins.map(p => `${p.name}@${p.version}`))\n telemetry.decorateEvent(`BUILD_END`, {\n plugins: pluginsStr,\n })\n\n telemetry.decorateEvent(`DEVELOP_STOP`, {\n plugins: pluginsStr,\n })\n\n // Start plugin runner which listens to the store\n // and invokes Gatsby API based on actions.\n startPluginRunner()\n\n // onPreInit\n activity = reporter.activityTimer(`onPreInit`, {\n parentSpan,\n })\n activity.start()\n await apiRunnerNode(`onPreInit`, { parentSpan: activity.span })\n activity.end()\n\n const lmdbCacheDirectoryName = `caches-lmdb`\n\n const cacheDirectory = `${program.directory}/.cache`\n const publicDirectory = `${program.directory}/public`\n const workerCacheDirectory = `${program.directory}/.cache/worker`\n const lmdbCacheDirectory = `${program.directory}/.cache/${lmdbCacheDirectoryName}`\n\n const cacheJsonDirExists = fs.existsSync(`${cacheDirectory}/json`)\n const publicDirExists = fs.existsSync(publicDirectory)\n const workerCacheDirExists = fs.existsSync(workerCacheDirectory)\n const lmdbCacheDirExists = fs.existsSync(lmdbCacheDirectory)\n\n // check the cache file that is used by the current configuration\n const cacheDirExists = lmdbStoreIsUsed\n ? lmdbCacheDirExists\n : cacheJsonDirExists\n\n // For builds in case public dir exists, but cache doesn't, we need to clean up potentially stale\n // artifacts from previous builds (due to cache not being available, we can't rely on tracking of artifacts)\n if (\n process.env.NODE_ENV === `production` &&\n publicDirExists &&\n !cacheDirExists\n ) {\n activity = reporter.activityTimer(\n `delete html and css files from previous builds`,\n {\n parentSpan,\n }\n )\n activity.start()\n const files = await glob(\n [\n `public/**/*.{html,css}`,\n `!public/page-data/**/*`,\n `!public/static`,\n `!public/static/**/*.{html,css}`,\n ],\n {\n cwd: program.directory,\n }\n )\n await Promise.all(files.map(file => fs.remove(file)))\n activity.end()\n }\n\n // When the main process and workers communicate they save parts of their redux state to .cache/worker\n // We should clean this directory to remove stale files that a worker might accidentally reuse then\n if (\n workerCacheDirExists &&\n process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING\n ) {\n activity = reporter.activityTimer(\n `delete worker cache from previous builds`,\n {\n parentSpan,\n }\n )\n activity.start()\n await fs\n .remove(workerCacheDirectory)\n .catch(() => fs.emptyDir(workerCacheDirectory))\n activity.end()\n }\n\n activity = reporter.activityTimer(`initialize cache`, {\n parentSpan,\n })\n activity.start()\n // Check if any plugins have been updated since our last run. If so,\n // we delete the cache as there's likely been changes since\n // the previous run.\n //\n // We do this by creating a hash of all the version numbers of installed\n // plugins, the site's package.json, gatsby-config.js, and gatsby-node.js.\n // The last, gatsby-node.js, is important as many gatsby sites put important\n // logic in there e.g. generating slugs for custom pages.\n const pluginVersions = flattenedPlugins.map(p => p.version)\n // we should include gatsby version as well\n pluginVersions.push(require(`../../package.json`).version)\n const optionalFiles = [\n `${program.directory}/gatsby-config.js`,\n `${program.directory}/gatsby-node.js`,\n `${program.directory}/gatsby-config.ts`,\n `${program.directory}/gatsby-node.ts`,\n ] as Array<string>\n\n const state = store.getState()\n\n const hashes = await Promise.all(\n // Ignore optional files with .catch() as these are not required\n [md5File(`package.json`), state.config.trailingSlash as string].concat(\n optionalFiles.map(f => md5File(f).catch(() => ``))\n )\n )\n\n const pluginsHash = crypto\n .createHash(`md5`)\n .update(JSON.stringify(pluginVersions.concat(hashes)))\n .digest(`hex`)\n\n const oldPluginsHash = state && state.status ? state.status.PLUGINS_HASH : ``\n\n // Check if anything has changed. If it has, delete the site's .cache\n // directory and tell reducers to empty themselves.\n //\n // Also if the hash isn't there, then delete things just in case something\n // is weird.\n if (oldPluginsHash && pluginsHash !== oldPluginsHash) {\n reporter.info(reporter.stripIndent`\n One or more of your plugins have changed since the last time you ran Gatsby. As\n a precaution, we're deleting your site's cache to ensure there's no stale data.\n `)\n }\n\n // .cache directory exists in develop at this point\n // so checking for .cache/json or .cache/caches-lmdb as a heuristic (could be any expected file)\n const cacheIsCorrupt = cacheDirExists && !publicDirExists\n if (cacheIsCorrupt) {\n reporter.info(reporter.stripIndent`\n We've detected that the Gatsby cache is incomplete (the .cache directory exists\n but the public directory does not). As a precaution, we're deleting your site's\n cache to ensure there's no stale data.\n `)\n }\n\n if (!oldPluginsHash || pluginsHash !== oldPluginsHash || cacheIsCorrupt) {\n try {\n // Comment out inviet until we can test perf impact\n //\n // let sourceFileSystemVersion = flattenedPlugins.find(\n // plugin => plugin.name === `gatsby-source-filesystem`\n // )?.version\n\n // // The site might be using a plugin which uses \"createRemoteFileNode\" but\n // // doesn't have gatsby-source-filesystem in their gatsby-config.js. So lets\n // // also try requiring it.\n // if (!sourceFileSystemVersion) {\n // try {\n // sourceFileSystemVersion = require(`gatsby-source-filesystem/package.json`)\n // ?.version\n // } catch {\n // // ignore require errors\n // }\n // }\n // } else if (\n // sourceFileSystemVersion &&\n // semver.lt(sourceFileSystemVersion, `2.9.0`)\n // ) {\n // // If the site has more than 50 downloaded files in it, tell them\n // // how to save time.\n // try {\n // // Divide by two as the directory as both cache files + the actual downloaded files so\n // // two results / downloaded file.\n // const filesCount =\n // (await fs.readdir(`.cache/caches/gatsby-source-filesystem`))\n // .length / 2\n // if (filesCount > 50) {\n // reporter.info(stripIndent`\\n\\n\n\n // Your local development experience is about to get better, faster, and stronger!\n\n // Your friendly Gatsby maintainers detected your site downloads quite a few files and that we're about to delete all ${Math.round(\n // filesCount\n // )} of them 😅. We're working right now to make our caching smarter which means we won't delete your downloaded files any more.\n\n // If you're interested in trialing the new caching behavior *today* — which should make your local development environment faster, go ahead and enable the PRESERVE_FILE_DOWNLOAD_CACHE flag and run your develop server again.\n\n // To do so, add to your gatsby-config.js:\n\n // flags: {\n // preserve_file_download_cache: true,\n // }\n\n // visit the umbrella issue to learn more: https://github.com/gatsbyjs/gatsby/discussions/28331\n // `)\n // }\n // } catch {\n // // ignore errors (mostly will just be directory not found).\n // }\n // }\n\n const deleteGlobs = [\n // By default delete all files & subdirectories\n `.cache/**`,\n `.cache/data/**`,\n `!.cache/data/gatsby-core-utils/**`,\n `!.cache/compiled`,\n ]\n\n if (process.env.GATSBY_EXPERIMENTAL_PRESERVE_FILE_DOWNLOAD_CACHE) {\n // Stop the caches directory from being deleted, add all sub directories,\n // but remove gatsby-source-filesystem\n deleteGlobs.push(`!.cache/caches`)\n deleteGlobs.push(`.cache/caches/*`)\n deleteGlobs.push(`!.cache/caches/gatsby-source-filesystem`)\n }\n\n if (process.env.GATSBY_EXPERIMENTAL_PRESERVE_WEBPACK_CACHE) {\n // Add webpack\n deleteGlobs.push(`!.cache/webpack`)\n }\n\n const files = await glob(deleteGlobs, {\n cwd: program.directory,\n })\n\n await Promise.all(files.map(file => fs.remove(file)))\n } catch (e) {\n reporter.error(`Failed to remove .cache files.`, e)\n }\n // Tell reducers to delete their data (the store will already have\n // been loaded from the file system cache).\n store.dispatch({\n type: `DELETE_CACHE`,\n cacheIsCorrupt,\n })\n\n // make sure all previous mutexes are released\n await releaseAllMutexes()\n\n // in future this should show which plugin's caches are purged\n // possibly should also have which plugins had caches\n telemetry.decorateEvent(`BUILD_END`, {\n pluginCachesPurged: [`*`],\n })\n telemetry.decorateEvent(`DEVELOP_STOP`, {\n pluginCachesPurged: [`*`],\n })\n }\n\n // Update the store with the new plugins hash.\n store.dispatch({\n type: `UPDATE_PLUGINS_HASH`,\n payload: pluginsHash,\n })\n\n // Now that we know the .cache directory is safe, initialize the cache\n // directory.\n await fs.ensureDir(cacheDirectory)\n\n // Ensure the public/static directory\n await fs.ensureDir(`${publicDirectory}/static`)\n\n // Init plugins once cache is initialized\n await apiRunnerNode(`onPluginInit`, {\n parentSpan: activity.span,\n })\n\n activity.end()\n\n activity = reporter.activityTimer(`copy gatsby files`, {\n parentSpan,\n })\n activity.start()\n const srcDir = `${__dirname}/../../cache-dir`\n const siteDir = cacheDirectory\n const tryRequire = `${__dirname}/../utils/test-require-error.js`\n try {\n await fs.copy(srcDir, siteDir, {\n overwrite: true,\n })\n await fs.copy(tryRequire, `${siteDir}/test-require-error.js`)\n if (lmdbStoreIsUsed) {\n await fs.ensureDir(`${cacheDirectory}/${lmdbCacheDirectoryName}`)\n } else {\n await fs.ensureDir(`${cacheDirectory}/json`)\n }\n\n // Ensure .cache/fragments exists and is empty. We want fragments to be\n // added on every run in response to data as fragments can only be added if\n // the data used to create the schema they're dependent on is available.\n await fs.emptyDir(`${cacheDirectory}/fragments`)\n } catch (err) {\n reporter.panic(`Unable to copy site files to .cache`, err)\n }\n\n // Find plugins which implement gatsby-browser and gatsby-ssr and write\n // out api-runners for them.\n const hasAPIFile = (env, plugin): string | undefined => {\n // The plugin loader has disabled SSR APIs for this plugin. Usually due to\n // multiple implementations of an API that can only be implemented once\n if (env === `ssr` && plugin.skipSSR === true) return undefined\n\n const envAPIs = plugin[`${env}APIs`]\n\n // Always include gatsby-browser.js files if they exist as they're\n // a handy place to include global styles and other global imports.\n try {\n if (env === `browser`) {\n const modulePath = path.join(plugin.resolve, `gatsby-${env}`)\n return slash(resolveModule(modulePath) as string)\n }\n } catch (e) {\n // ignore\n }\n\n if (envAPIs && Array.isArray(envAPIs) && envAPIs.length > 0) {\n const modulePath = path.join(plugin.resolve, `gatsby-${env}`)\n return slash(resolveModule(modulePath) as string)\n }\n return undefined\n }\n\n const isResolved = (plugin): plugin is IPluginResolution => !!plugin.resolve\n const isResolvedSSR = (plugin): plugin is IPluginResolutionSSR =>\n !!plugin.resolve\n\n const ssrPlugins: Array<IPluginResolutionSSR> = flattenedPlugins\n .map(plugin => {\n return {\n name: plugin.name,\n resolve: hasAPIFile(`ssr`, plugin),\n options: plugin.pluginOptions,\n }\n })\n .filter(isResolvedSSR)\n\n const browserPlugins: Array<IPluginResolution> = flattenedPlugins\n .map(plugin => {\n return {\n resolve: hasAPIFile(`browser`, plugin),\n options: plugin.pluginOptions,\n }\n })\n .filter(isResolved)\n\n const browserPluginsRequires = browserPlugins\n .map(plugin => {\n // we need a relative import path to keep contenthash the same if directory changes\n const relativePluginPath = path.relative(siteDir, plugin.resolve)\n return `{\n plugin: require('${slash(relativePluginPath)}'),\n options: ${JSON.stringify(plugin.options)},\n }`\n })\n .join(`,`)\n\n const browserAPIRunner = `module.exports = [${browserPluginsRequires}]\\n`\n\n let sSRAPIRunner = ``\n\n try {\n sSRAPIRunner = fs.readFileSync(`${siteDir}/api-runner-ssr.js`, `utf-8`)\n } catch (err) {\n reporter.panic(`Failed to read ${siteDir}/api-runner-ssr.js`, err)\n }\n\n const ssrPluginsRequires = ssrPlugins\n .map(\n plugin =>\n `{\n name: '${plugin.name}',\n plugin: require('${plugin.resolve}'),\n options: ${JSON.stringify(plugin.options)},\n }`\n )\n .join(`,`)\n sSRAPIRunner = `var plugins = [${ssrPluginsRequires}]\\n${sSRAPIRunner}`\n\n fs.writeFileSync(\n `${siteDir}/api-runner-browser-plugins.js`,\n browserAPIRunner,\n `utf-8`\n )\n fs.writeFileSync(`${siteDir}/api-runner-ssr.js`, sSRAPIRunner, `utf-8`)\n\n activity.end()\n /**\n * Start the main bootstrap processes.\n */\n\n // onPreBootstrap\n activity = reporter.activityTimer(`onPreBootstrap`, {\n parentSpan,\n })\n activity.start()\n await apiRunnerNode(`onPreBootstrap`, {\n parentSpan: activity.span,\n })\n activity.end()\n\n // Track trailing slash option used in config\n telemetry.trackFeatureIsUsed(`trailingSlash:${state.config.trailingSlash}`)\n\n // Collect resolvable extensions and attach to program.\n const extensions = [`.mjs`, `.js`, `.jsx`, `.wasm`, `.json`]\n // Change to this being an action and plugins implement `onPreBootstrap`\n // for adding extensions.\n const apiResults = await apiRunnerNode(`resolvableExtensions`, {\n traceId: `initial-resolvableExtensions`,\n parentSpan,\n })\n\n store.dispatch({\n type: `SET_PROGRAM_EXTENSIONS`,\n payload: _.flattenDeep([extensions, apiResults]),\n })\n\n const workerPool = WorkerPool.create()\n\n if (state.config.graphqlTypegen) {\n telemetry.trackFeatureIsUsed(`GraphQLTypegen`)\n // This is only run during `gatsby develop`\n if (process.env.gatsby_executing_command === `develop`) {\n writeGraphQLConfig(program)\n }\n }\n\n let initialWebhookBody: WebhookBody = undefined\n\n if (process.env.GATSBY_INITIAL_WEBHOOK_BODY) {\n try {\n initialWebhookBody = JSON.parse(process.env.GATSBY_INITIAL_WEBHOOK_BODY)\n } catch (e) {\n reporter.error(\n `Failed to parse GATSBY_INITIAL_WEBHOOK_BODY as JSON:\\n\"${e.message}\"`\n )\n }\n }\n\n return {\n store,\n workerPool,\n webhookBody: initialWebhookBody,\n }\n}\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;AAWA;AACA;AACA,IACEA,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAA1C,IACAF,OAAO,CAACC,GAAR,CAAYE,4BADZ,IAEA,CAAC,IAAAC,qBAAA,GAFD,IAGA;AACA;AACA,CAACJ,OAAO,CAACC,GAAR,CAAYI,yBANf,EAOE;EACAL,OAAO,CAACC,GAAR,CAAYK,2BAAZ,GAA2C,MAA3C;EACAN,OAAO,CAACC,GAAR,CAAYM,4BAAZ,GAA4C,MAA5C;EACAP,OAAO,CAACC,GAAR,CAAYO,sBAAZ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AAF,EAAU,KAAV,EAAiB,MAAjB,EAAyB,OAAzB,EAAkC,OAAlC,CAAnB,CAhjBC,CAijBD;EACA;;EACA,MAAMgI,UAAU,GAAG,MAAM,IAAAtF,sBAAA,EAAe,sBAAf,EAAsC;IAC7DuF,OAAO,EAAG,8BADmD;IAE7DnJ;EAF6D,CAAtC,CAAzB;;EAKAG,YAAA,CAAMkB,QAAN,CAAe;IACbC,IAAI,EAAG,wBADM;IAEbC,OAAO,EAAE,2BAAc,CAACL,UAAD,EAAagI,UAAb,CAAd;EAFI,CAAf;;EAKA,MAAME,UAAU,GAAGC,UAAU,CAACC,MAAX,EAAnB;;EAEA,IAAI9D,KAAK,CAACpD,MAAN,CAAamH,cAAjB,EAAiC;IAC/B/J,wBAAA,CAAUC,kBAAV,CAA8B,gBAA9B,EAD+B,CAE/B;;;IACA,IAAIZ,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAA9C,EAAwD;MACtD,IAAAyK,8BAAA,EAAmB1J,OAAnB;IACD;EACF;;EAED,IAAI2J,kBAA+B,GAAG/B,SAAtC;;EAEA,IAAI7I,OAAO,CAACC,GAAR,CAAY4K,2BAAhB,EAA6C;IAC3C,IAAI;MACFD,kBAAkB,GAAG3I,IAAI,CAAC6I,KAAL,CAAW9K,OAAO,CAACC,GAAR,CAAY4K,2BAAvB,CAArB;IACD,CAFD,CAEE,OAAO/C,CAAP,EAAU;MACVrH,iBAAA,CAASsH,KAAT,CACG,0DAAyDD,CAAC,CAACiD,OAAQ,GADtE;IAGD;EACF;;EAED,OAAO;IACLzJ,KAAK,EAALA,YADK;IAELiJ,UAFK;IAGLS,WAAW,EAAEJ;EAHR,CAAP;AAKD"}
@@ -89,8 +89,11 @@ const createWebpackUtils = (stage, program) => {
89
89
  },
90
90
  yaml: (options = {}) => {
91
91
  return {
92
- options,
93
- loader: require.resolve(`yaml-loader`)
92
+ loader: require.resolve(`yaml-loader`),
93
+ options: {
94
+ asJSON: true,
95
+ ...options
96
+ }
94
97
  };
95
98
  },
96
99
  null: (options = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-utils.js","names":["vendorRegex","createWebpackUtils","stage","program","assetRelativeRoot","supportedBrowsers","getBrowsersList","directory","PRODUCTION","includes","isSSR","config","store","getState","makeExternalOnly","original","options","rule","include","makeInternalOnly","exclude","fileLoaderCommonOptions","name","outputPath","path","relative","ROUTES_DIRECTORY","publicPath","loaders","json","loader","require","resolve","yaml","null","raw","style","miniCssExtract","moduleOptions","undefined","modules","restOptions","namedExport","MiniCssExtractPlugin","css","modulesOptions","auto","localIdentName","exportLocalsConvention","exportOnlyLocals","url","startsWith","sourceMap","postcss","plugins","overrideBrowserslist","postcssOpts","execute","postcssOptions","loaderContext","postCSSPlugins","autoprefixerPlugin","autoprefixer","flexbox","find","plugin","postcssPlugin","unshift","flexbugs","file","limit","fallback","js","reactRuntime","jsxRuntime","reactImportSource","jsxImportSource","cacheDirectory","join","rootDir","dependencies","rules","modulesThatUseGatsby","test","modulePath","some","module","type","use","resourceQuery","issuer","configFile","compact","isPageTemplate","jsOptions","babelrc","presets","sourceMaps","cacheIdentifier","JSON","stringify","browsersList","gatsbyPreset","version","VENDORS_TO_NOT_POLYFILL","doNotPolyfillRegex","RegExp","fonts","images","media","miscAssets","browsers","importLoaders","filter","Boolean","internal","external","cssModules","builtinPlugins","minifyJs","terserOptions","TerserPlugin","ie8","mangle","safari10","parse","ecma","compress","output","parallel","Math","max","cpuCoreCount","minifyCss","minimizerOptions","preset","svgo","full","CssMinimizerPlugin","fastRefresh","regExpToHack","ReactRefreshWebpackPlugin","overlay","sockIntegration","__dirname","extractText","moment","ignore","resourceRegExp","contextRegExp","extractStats","GatsbyWebpackStatsExtractor","eslintGraphqlSchemaReload","virtualModules","GatsbyWebpackVirtualModules","eslint","extensions","VIRTUAL_MODULES_BASE_PATH","eslintConfig","ESLintPlugin","eslintRequired","eslintRequiredConfig"],"sources":["../../src/utils/webpack-utils.ts"],"sourcesContent":["import * as path from \"path\"\nimport { RuleSetRule, WebpackPluginInstance } from \"webpack\"\nimport { GraphQLSchema } from \"graphql\"\nimport { Plugin as PostCSSPlugin } from \"postcss\"\nimport autoprefixer from \"autoprefixer\"\nimport flexbugs from \"postcss-flexbugs-fixes\"\nimport TerserPlugin from \"terser-webpack-plugin\"\nimport type { MinifyOptions as TerserOptions } from \"terser\"\nimport MiniCssExtractPlugin from \"mini-css-extract-plugin\"\nimport CssMinimizerPlugin from \"css-minimizer-webpack-plugin\"\nimport ReactRefreshWebpackPlugin from \"@pmmmwh/react-refresh-webpack-plugin\"\nimport { getBrowsersList } from \"./browserslist\"\nimport ESLintPlugin from \"eslint-webpack-plugin\"\nimport { cpuCoreCount } from \"gatsby-core-utils\"\nimport { GatsbyWebpackStatsExtractor } from \"./gatsby-webpack-stats-extractor\"\nimport {\n GatsbyWebpackVirtualModules,\n VIRTUAL_MODULES_BASE_PATH,\n} from \"./gatsby-webpack-virtual-modules\"\n\nimport { builtinPlugins } from \"./webpack-plugins\"\nimport { IProgram, Stage } from \"../commands/types\"\nimport { eslintConfig, eslintRequiredConfig } from \"./eslint-config\"\nimport { store } from \"../redux\"\nimport type { RuleSetUseItem } from \"webpack\"\nimport { ROUTES_DIRECTORY } from \"../constants\"\n\ntype Loader = string | { loader: string; options?: { [name: string]: any } }\ntype LoaderResolver<T = Record<string, unknown>> = (options?: T) => Loader\n\ntype LoaderOptions = Record<string, any>\ntype RuleFactory<T = Record<string, unknown>> = (\n options?: T & LoaderOptions\n) => RuleSetRule\n\ntype ContextualRuleFactory<T = Record<string, unknown>> = RuleFactory<T> & {\n internal?: RuleFactory<T>\n external?: RuleFactory<T>\n}\n\ntype PluginFactory = (...args: any) => WebpackPluginInstance | null\n\ntype BuiltinPlugins = typeof builtinPlugins\n\ntype CSSModulesOptions =\n | boolean\n | string\n | {\n mode?:\n | \"local\"\n | \"global\"\n | \"pure\"\n | ((resourcePath: string) => \"local\" | \"global\" | \"pure\")\n auto?: boolean\n exportGlobals?: boolean\n localIdentName?: string\n localIdentContext?: string\n localIdentHashPrefix?: string\n namedExport?: boolean\n exportLocalsConvention?:\n | \"asIs\"\n | \"camelCaseOnly\"\n | \"camelCase\"\n | \"dashes\"\n | \"dashesOnly\"\n exportOnlyLocals?: boolean\n }\n\ntype MiniCSSExtractLoaderModuleOptions =\n | undefined\n | boolean\n | {\n namedExport?: boolean\n }\n/**\n * Utils that produce webpack `loader` objects\n */\ninterface ILoaderUtils {\n yaml: LoaderResolver\n style: LoaderResolver\n css: LoaderResolver<{\n url?: boolean | ((url: string, resourcePath: string) => boolean)\n import?:\n | boolean\n | ((url: string, media: string, resourcePath: string) => boolean)\n modules?: CSSModulesOptions\n sourceMap?: boolean\n importLoaders?: number\n esModule?: boolean\n }>\n postcss: LoaderResolver<{\n browsers?: Array<string>\n overrideBrowserslist?: Array<string>\n plugins?: Array<PostCSSPlugin> | ((loader: Loader) => Array<PostCSSPlugin>)\n }>\n\n file: LoaderResolver\n url: LoaderResolver\n js: LoaderResolver\n json: LoaderResolver\n null: LoaderResolver\n raw: LoaderResolver\n dependencies: LoaderResolver\n\n miniCssExtract: LoaderResolver\n imports?: LoaderResolver\n exports?: LoaderResolver\n}\n\ninterface IModuleThatUseGatsby {\n name: string\n path: string\n}\n\ntype CssLoaderModuleOption = boolean | Record<string, any> | string\n\n/**\n * Utils that produce webpack rule objects\n */\ninterface IRuleUtils {\n /**\n * Handles JavaScript compilation via babel\n */\n js: RuleFactory<{ modulesThatUseGatsby?: Array<IModuleThatUseGatsby> }>\n dependencies: RuleFactory<{\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n }>\n yaml: RuleFactory\n fonts: RuleFactory\n images: RuleFactory\n miscAssets: RuleFactory\n media: RuleFactory\n\n css: ContextualRuleFactory<{\n browsers?: Array<string>\n modules?: CssLoaderModuleOption\n }>\n cssModules: RuleFactory\n postcss: ContextualRuleFactory<{ overrideBrowserOptions: Array<string> }>\n\n eslint: (schema: GraphQLSchema) => RuleSetRule\n eslintRequired: () => RuleSetRule\n}\n\ntype PluginUtils = BuiltinPlugins & {\n extractText: PluginFactory\n uglify: PluginFactory\n moment: PluginFactory\n extractStats: PluginFactory\n minifyJs: PluginFactory\n minifyCss: PluginFactory\n fastRefresh: PluginFactory\n eslintGraphqlSchemaReload: PluginFactory\n virtualModules: PluginFactory\n eslint: PluginFactory\n eslintRequired: PluginFactory\n}\n\n/**\n * webpack atoms namespace\n */\ninterface IWebpackUtils {\n loaders: ILoaderUtils\n\n rules: IRuleUtils\n\n plugins: PluginUtils\n}\n\nconst vendorRegex = /(node_modules|bower_components)/\n\n/**\n * A factory method that produces an atoms namespace\n */\nexport const createWebpackUtils = (\n stage: Stage,\n program: IProgram\n): IWebpackUtils => {\n const assetRelativeRoot = `static/`\n const supportedBrowsers = getBrowsersList(program.directory)\n\n const PRODUCTION = !stage.includes(`develop`)\n\n const isSSR = stage.includes(`html`)\n const { config } = store.getState()\n\n const makeExternalOnly =\n (original: RuleFactory) =>\n (options = {}): RuleSetRule => {\n const rule = original(options)\n rule.include = vendorRegex\n return rule\n }\n\n const makeInternalOnly =\n (original: RuleFactory) =>\n (options = {}): RuleSetRule => {\n const rule = original(options)\n rule.exclude = vendorRegex\n return rule\n }\n\n const fileLoaderCommonOptions: {\n name: string\n publicPath?: string\n outputPath?: string\n } = {\n name: `${assetRelativeRoot}[name]-[hash].[ext]`,\n }\n\n if (stage === `build-html` || stage === `develop-html`) {\n // build-html and develop-html outputs to `.cache/page-ssr/routes/` (ROUTES_DIRECTORY)\n // so this config is setting it to output assets to `public` (outputPath)\n // while preserving \"url\" (publicPath)\n fileLoaderCommonOptions.outputPath = path.relative(\n ROUTES_DIRECTORY,\n `public`\n )\n fileLoaderCommonOptions.publicPath = `/`\n }\n\n const loaders: ILoaderUtils = {\n json: (options = {}) => {\n return {\n options,\n loader: require.resolve(`json-loader`),\n }\n },\n yaml: (options = {}) => {\n return {\n options,\n loader: require.resolve(`yaml-loader`),\n }\n },\n\n null: (options = {}) => {\n return {\n options,\n loader: require.resolve(`null-loader`),\n }\n },\n\n raw: (options = {}) => {\n return {\n options,\n loader: require.resolve(`raw-loader`),\n }\n },\n\n style: (options = {}) => {\n return {\n options,\n loader: require.resolve(`style-loader`),\n }\n },\n\n // TODO(v5): Re-Apply https://github.com/gatsbyjs/gatsby/pull/33979 with breaking change in inline loader syntax\n miniCssExtract: (\n options: {\n modules?: MiniCSSExtractLoaderModuleOptions\n } = {}\n ) => {\n let moduleOptions: MiniCSSExtractLoaderModuleOptions = undefined\n\n const { modules, ...restOptions } = options\n\n if (typeof modules === `boolean` && options.modules) {\n moduleOptions = {\n namedExport: true,\n }\n } else {\n moduleOptions = modules\n }\n\n return {\n loader: MiniCssExtractPlugin.loader,\n options: {\n modules: moduleOptions,\n ...restOptions,\n },\n }\n },\n\n css: (options = {}) => {\n let modulesOptions: CSSModulesOptions = false\n if (options.modules) {\n modulesOptions = {\n auto: undefined,\n namedExport: true,\n localIdentName: `[name]--[local]--[hash:hex:5]`,\n exportLocalsConvention: `dashesOnly`,\n exportOnlyLocals: isSSR,\n }\n\n if (typeof options.modules === `object`) {\n modulesOptions = {\n ...modulesOptions,\n ...options.modules,\n }\n }\n }\n\n return {\n loader: require.resolve(`css-loader`),\n options: {\n // Absolute urls (https or //) are not send to this function. Only resolvable paths absolute or relative ones.\n url: function (url: string): boolean {\n // When an url starts with /\n if (url.startsWith(`/`)) {\n return false\n }\n\n return true\n },\n sourceMap: !PRODUCTION,\n modules: modulesOptions,\n },\n }\n },\n\n postcss: (options = {}) => {\n const {\n plugins,\n overrideBrowserslist = supportedBrowsers,\n ...postcssOpts\n } = options\n\n return {\n loader: require.resolve(`postcss-loader`),\n options: {\n execute: false,\n sourceMap: !PRODUCTION,\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n postcssOptions: (loaderContext: any) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let postCSSPlugins: Array<PostCSSPlugin> = []\n if (plugins) {\n postCSSPlugins =\n typeof plugins === `function` ? plugins(loaderContext) : plugins\n }\n\n const autoprefixerPlugin = autoprefixer({\n overrideBrowserslist,\n flexbox: `no-2009`,\n ...((\n postCSSPlugins.find(\n plugin => plugin.postcssPlugin === `autoprefixer`\n ) as unknown as autoprefixer.ExportedAPI\n )?.options ?? {}),\n })\n\n postCSSPlugins.unshift(autoprefixerPlugin)\n postCSSPlugins.unshift(flexbugs)\n\n return {\n plugins: postCSSPlugins,\n ...postcssOpts,\n }\n },\n },\n }\n },\n\n file: (options = {}) => {\n return {\n loader: require.resolve(`file-loader`),\n options: {\n ...fileLoaderCommonOptions,\n ...options,\n },\n }\n },\n\n url: (options = {}) => {\n return {\n loader: require.resolve(`url-loader`),\n options: {\n limit: 10000,\n ...fileLoaderCommonOptions,\n fallback: require.resolve(`file-loader`),\n ...options,\n },\n }\n },\n\n js: options => {\n return {\n options: {\n stage,\n reactRuntime: config.jsxRuntime,\n reactImportSource: config.jsxImportSource,\n cacheDirectory: path.join(\n program.directory,\n `.cache`,\n `webpack`,\n `babel`\n ),\n ...options,\n rootDir: program.directory,\n },\n loader: require.resolve(`./babel-loader`),\n }\n },\n\n dependencies: options => {\n return {\n options: {\n cacheDirectory: path.join(\n program.directory,\n `.cache`,\n `webpack`,\n `babel`\n ),\n ...options,\n },\n loader: require.resolve(`babel-loader`),\n }\n },\n }\n\n /**\n * Rules\n */\n const rules = {} as IRuleUtils\n\n /**\n * JavaScript loader via babel, includes userland code\n * and packages that depend on `gatsby`\n */\n {\n const js = ({\n modulesThatUseGatsby = [],\n ...options\n }: {\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n } = {}): RuleSetRule => {\n return {\n test: /\\.(js|mjs|jsx|ts|tsx)$/,\n include: (modulePath: string): boolean => {\n // when it's not coming from node_modules we treat it as a source file.\n if (!vendorRegex.test(modulePath)) {\n return true\n }\n\n // If the module uses Gatsby as a dependency\n // we want to treat it as src so we can extract queries\n return modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n },\n type: `javascript/auto`,\n use: ({ resourceQuery, issuer }): Array<RuleSetUseItem> => [\n // If a JS import comes from async-requires, assume it is for a page component.\n // Using `issuer` allows us to avoid mutating async-requires for this case.\n //\n // If other imports are added to async-requires in the future, another option is to\n // append a query param to page components in the store and check against `resourceQuery` here.\n //\n // This would require we adjust `doesModuleMatchResourcePath` in `static-query-mapper`\n // to check against the module's `resourceResolveData.path` instead of resource to avoid\n // mismatches because of the added query param. Other adjustments may also be needed.\n loaders.js({\n ...options,\n configFile: true,\n compact: PRODUCTION,\n isPageTemplate: /async-requires/.test(issuer),\n resourceQuery,\n }),\n ],\n }\n }\n rules.js = js\n }\n\n /**\n * Node_modules JavaScript loader via babel\n * Excludes core-js & babel-runtime to speedup babel transpilation\n * Excludes modules that use Gatsby since the `rules.js` already transpiles those\n */\n {\n const dependencies = ({\n modulesThatUseGatsby = [],\n }: {\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n } = {}): RuleSetRule => {\n const jsOptions = {\n babelrc: false,\n configFile: false,\n compact: false,\n presets: [\n [\n require.resolve(`babel-preset-gatsby/dependencies`),\n {\n stage,\n },\n ],\n ],\n // If an error happens in a package, it's possible to be\n // because it was compiled. Thus, we don't want the browser\n // debugger to show the original code. Instead, the code\n // being evaluated would be much more helpful.\n sourceMaps: false,\n\n cacheIdentifier: JSON.stringify({\n browsersList: supportedBrowsers,\n gatsbyPreset: require(`babel-preset-gatsby/package.json`).version,\n }),\n }\n\n // TODO REMOVE IN V3\n // a list of vendors we know we shouldn't polyfill (we should have set core-js to entry but we didn't so we have to do this)\n const VENDORS_TO_NOT_POLYFILL = [\n `@babel[\\\\\\\\/]runtime`,\n `@mikaelkristiansson[\\\\\\\\/]domready`,\n `@reach[\\\\\\\\/]router`,\n `babel-preset-gatsby`,\n `core-js`,\n `dom-helpers`,\n `gatsby-legacy-polyfills`,\n `gatsby-link`,\n `gatsby-script`,\n `gatsby-react-router-scroll`,\n `invariant`,\n `lodash`,\n `mitt`,\n `prop-types`,\n `react-dom`,\n `react`,\n `regenerator-runtime`,\n `scheduler`,\n `scroll-behavior`,\n `shallow-compare`,\n `warning`,\n `webpack`,\n ]\n const doNotPolyfillRegex = new RegExp(\n `[\\\\\\\\/]node_modules[\\\\\\\\/](${VENDORS_TO_NOT_POLYFILL.join(\n `|`\n )})[\\\\\\\\/]`\n )\n\n return {\n test: /\\.(js|mjs)$/,\n exclude: (modulePath: string): boolean => {\n // If dep is user land code, exclude\n if (!vendorRegex.test(modulePath)) {\n return true\n }\n\n // If dep uses Gatsby, exclude\n if (\n modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n ) {\n return true\n }\n\n return doNotPolyfillRegex.test(modulePath)\n },\n type: `javascript/auto`,\n use: [loaders.dependencies(jsOptions)],\n }\n }\n rules.dependencies = dependencies\n }\n\n rules.yaml = (): RuleSetRule => {\n return {\n test: /\\.ya?ml$/,\n type: `json`,\n use: [loaders.yaml()],\n }\n }\n\n /**\n * Font loader\n */\n rules.fonts = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(eot|otf|ttf|woff(2)?)(\\?.*)?$/,\n }\n }\n\n /**\n * Loads image assets, inlines images via a data URI if they are below\n * the size threshold\n */\n rules.images = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(ico|svg|jpg|jpeg|png|gif|webp|avif)(\\?.*)?$/,\n }\n }\n\n /**\n * Loads audio and video and inlines them via a data URI if they are below\n * the size threshold\n */\n rules.media = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)$/,\n }\n }\n\n /**\n * Loads assets without inlining\n */\n rules.miscAssets = (): RuleSetRule => {\n return {\n use: [loaders.file()],\n test: /\\.pdf$/,\n }\n }\n\n /**\n * CSS style loader.\n */\n {\n const css: IRuleUtils[\"css\"] = (options = {}): RuleSetRule => {\n const { browsers, ...restOptions } = options\n const use = [\n !isSSR && loaders.miniCssExtract(restOptions),\n loaders.css({ ...restOptions, importLoaders: 1 }),\n loaders.postcss({ browsers }),\n ].filter(Boolean) as RuleSetRule[\"use\"]\n\n return {\n use,\n test: /\\.css$/,\n }\n }\n\n /**\n * CSS style loader, _excludes_ node_modules.\n */\n css.internal = makeInternalOnly(css)\n css.external = makeExternalOnly(css)\n\n const cssModules: IRuleUtils[\"cssModules\"] = (options): RuleSetRule => {\n const rule = css({ ...options, modules: true })\n delete rule.exclude\n rule.test = /\\.module\\.css$/\n return rule\n }\n\n rules.css = css\n rules.cssModules = cssModules\n }\n\n /**\n * PostCSS loader.\n */\n {\n const postcss: ContextualRuleFactory = (options): RuleSetRule => {\n return {\n test: /\\.css$/,\n use: [loaders.css({ importLoaders: 1 }), loaders.postcss(options)],\n }\n }\n\n /**\n * PostCSS loader, _excludes_ node_modules.\n */\n postcss.internal = makeInternalOnly(postcss)\n postcss.external = makeExternalOnly(postcss)\n rules.postcss = postcss\n }\n /**\n * cast rules to IRuleUtils\n */\n /**\n * Plugins\n */\n const plugins = { ...builtinPlugins } as PluginUtils\n\n plugins.minifyJs = ({\n terserOptions,\n ...options\n }: {\n terserOptions?: TerserOptions\n } = {}): WebpackPluginInstance =>\n new TerserPlugin({\n exclude: /\\.min\\.js/,\n terserOptions: {\n ie8: false,\n mangle: {\n safari10: true,\n },\n parse: {\n ecma: 5,\n },\n compress: {\n ecma: 5,\n },\n output: {\n ecma: 5,\n },\n ...terserOptions,\n },\n parallel: Math.max(1, cpuCoreCount() - 1),\n ...options,\n })\n\n plugins.minifyCss = (\n options = {\n minimizerOptions: {\n preset: [\n `default`,\n {\n svgo: {\n full: true,\n plugins: [\n // potentially destructive plugins removed - see https://github.com/gatsbyjs/gatsby/issues/15629\n // use correct config format and remove plugins requiring specific params - see https://github.com/gatsbyjs/gatsby/issues/31619\n // List of default plugins and their defaults: https://github.com/svg/svgo#built-in-plugins\n // Last update 2021-08-17\n `cleanupAttrs`,\n `cleanupEnableBackground`,\n `cleanupIDs`,\n `cleanupListOfValues`, // Default: disabled\n `cleanupNumericValues`,\n `collapseGroups`,\n `convertColors`,\n `convertPathData`,\n `convertStyleToAttrs`, // Default: disabled\n `convertTransform`,\n `inlineStyles`,\n `mergePaths`,\n `minifyStyles`,\n `moveElemsAttrsToGroup`,\n `moveGroupAttrsToElems`,\n `prefixIds`, // Default: disabled\n `removeComments`,\n `removeDesc`,\n `removeDoctype`,\n `removeEditorsNSData`,\n `removeEmptyAttrs`,\n `removeEmptyContainers`,\n `removeEmptyText`,\n `removeHiddenElems`,\n `removeMetadata`,\n `removeNonInheritableGroupAttrs`,\n `removeRasterImages`, // Default: disabled\n `removeScriptElement`, // Default: disabled\n `removeStyleElement`, // Default: disabled\n `removeTitle`,\n `removeUnknownsAndDefaults`,\n `removeUnusedNS`,\n `removeUselessDefs`,\n `removeUselessStrokeAndFill`,\n `removeXMLProcInst`,\n `reusePaths`, // Default: disabled\n `sortAttrs`, // Default: disabled\n ],\n },\n },\n ],\n },\n }\n ): CssMinimizerPlugin =>\n new CssMinimizerPlugin({\n parallel: Math.max(1, cpuCoreCount() - 1),\n ...options,\n })\n\n plugins.fastRefresh = ({ modulesThatUseGatsby }): WebpackPluginInstance => {\n const regExpToHack = /node_modules/\n regExpToHack.test = (modulePath: string): boolean => {\n // when it's not coming from node_modules we treat it as a source file.\n if (!vendorRegex.test(modulePath)) {\n return false\n }\n\n // If the module uses Gatsby as a dependency\n // we want to treat it as src because of shadowing\n return !modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n }\n\n return new ReactRefreshWebpackPlugin({\n overlay: {\n sockIntegration: `whm`,\n module: path.join(__dirname, `fast-refresh-module`),\n },\n // this is a bit hacky - exclude expect string or regexp or array of those\n // so this is tricking ReactRefreshWebpackPlugin with providing regexp with\n // overwritten .test method\n exclude: regExpToHack,\n })\n }\n\n plugins.extractText = (options: any): WebpackPluginInstance =>\n new MiniCssExtractPlugin({\n ...options,\n })\n\n plugins.moment = (): WebpackPluginInstance =>\n plugins.ignore({ resourceRegExp: /^\\.\\/locale$/, contextRegExp: /moment$/ })\n\n plugins.extractStats = (): GatsbyWebpackStatsExtractor =>\n new GatsbyWebpackStatsExtractor()\n\n // TODO: remove this in v5\n plugins.eslintGraphqlSchemaReload = (): null => null\n\n plugins.virtualModules = (): GatsbyWebpackVirtualModules =>\n new GatsbyWebpackVirtualModules()\n\n plugins.eslint = (): WebpackPluginInstance => {\n const options = {\n extensions: [`js`, `jsx`],\n exclude: [\n `/node_modules/`,\n `/bower_components/`,\n VIRTUAL_MODULES_BASE_PATH,\n ],\n ...eslintConfig(config.jsxRuntime === `automatic`),\n }\n // @ts-ignore\n return new ESLintPlugin(options)\n }\n\n plugins.eslintRequired = (): WebpackPluginInstance => {\n const options = {\n extensions: [`js`, `jsx`],\n exclude: [\n `/node_modules/`,\n `/bower_components/`,\n VIRTUAL_MODULES_BASE_PATH,\n ],\n ...eslintRequiredConfig,\n }\n // @ts-ignore\n return new ESLintPlugin(options)\n }\n\n return {\n loaders,\n rules,\n plugins,\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AAEA;;;;;;AAgJA,MAAMA,WAAW,GAAG,iCAApB;AAEA;AACA;AACA;;AACO,MAAMC,kBAAkB,GAAG,CAChCC,KADgC,EAEhCC,OAFgC,KAGd;EAClB,MAAMC,iBAAiB,GAAI,SAA3B;EACA,MAAMC,iBAAiB,GAAG,IAAAC,6BAAA,EAAgBH,OAAO,CAACI,SAAxB,CAA1B;EAEA,MAAMC,UAAU,GAAG,CAACN,KAAK,CAACO,QAAN,CAAgB,SAAhB,CAApB;EAEA,MAAMC,KAAK,GAAGR,KAAK,CAACO,QAAN,CAAgB,MAAhB,CAAd;;EACA,MAAM;IAAEE;EAAF,IAAaC,YAAA,CAAMC,QAAN,EAAnB;;EAEA,MAAMC,gBAAgB,GACnBC,QAAD,IACA,CAACC,OAAO,GAAG,EAA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IAC5C,MAAM3I,OAAO,GAAG;MACd4I,UAAU,EAAE,CAAE,IAAF,EAAQ,KAAR,CADE;MAEdxI,OAAO,EAAE,CACN,gBADM,EAEN,oBAFM,EAGPyI,sDAHO,CAFK;MAOd,GAAG,IAAAC,0BAAA,EAAanJ,MAAM,CAAC+D,UAAP,KAAuB,WAApC;IAPW,CAAhB,CAD4C,CAU5C;;IACA,OAAO,IAAIqF,4BAAJ,CAAiB/I,OAAjB,CAAP;EACD,CAZD;;EAcAsC,OAAO,CAAC0G,cAAR,GAAyB,MAA6B;IACpD,MAAMhJ,OAAO,GAAG;MACd4I,UAAU,EAAE,CAAE,IAAF,EAAQ,KAAR,CADE;MAEdxI,OAAO,EAAE,CACN,gBADM,EAEN,oBAFM,EAGPyI,sDAHO,CAFK;MAOd,GAAGI;IAPW,CAAhB,CADoD,CAUpD;;IACA,OAAO,IAAIF,4BAAJ,CAAiB/I,OAAjB,CAAP;EACD,CAZD;;EAcA,OAAO;IACLY,OADK;IAELqD,KAFK;IAGL3B;EAHK,CAAP;AAKD,CA/pBM"}
1
+ {"version":3,"file":"webpack-utils.js","names":["vendorRegex","createWebpackUtils","stage","program","assetRelativeRoot","supportedBrowsers","getBrowsersList","directory","PRODUCTION","includes","isSSR","config","store","getState","makeExternalOnly","original","options","rule","include","makeInternalOnly","exclude","fileLoaderCommonOptions","name","outputPath","path","relative","ROUTES_DIRECTORY","publicPath","loaders","json","loader","require","resolve","yaml","asJSON","null","raw","style","miniCssExtract","moduleOptions","undefined","modules","restOptions","namedExport","MiniCssExtractPlugin","css","modulesOptions","auto","localIdentName","exportLocalsConvention","exportOnlyLocals","url","startsWith","sourceMap","postcss","plugins","overrideBrowserslist","postcssOpts","execute","postcssOptions","loaderContext","postCSSPlugins","autoprefixerPlugin","autoprefixer","flexbox","find","plugin","postcssPlugin","unshift","flexbugs","file","limit","fallback","js","reactRuntime","jsxRuntime","reactImportSource","jsxImportSource","cacheDirectory","join","rootDir","dependencies","rules","modulesThatUseGatsby","test","modulePath","some","module","type","use","resourceQuery","issuer","configFile","compact","isPageTemplate","jsOptions","babelrc","presets","sourceMaps","cacheIdentifier","JSON","stringify","browsersList","gatsbyPreset","version","VENDORS_TO_NOT_POLYFILL","doNotPolyfillRegex","RegExp","fonts","images","media","miscAssets","browsers","importLoaders","filter","Boolean","internal","external","cssModules","builtinPlugins","minifyJs","terserOptions","TerserPlugin","ie8","mangle","safari10","parse","ecma","compress","output","parallel","Math","max","cpuCoreCount","minifyCss","minimizerOptions","preset","svgo","full","CssMinimizerPlugin","fastRefresh","regExpToHack","ReactRefreshWebpackPlugin","overlay","sockIntegration","__dirname","extractText","moment","ignore","resourceRegExp","contextRegExp","extractStats","GatsbyWebpackStatsExtractor","eslintGraphqlSchemaReload","virtualModules","GatsbyWebpackVirtualModules","eslint","extensions","VIRTUAL_MODULES_BASE_PATH","eslintConfig","ESLintPlugin","eslintRequired","eslintRequiredConfig"],"sources":["../../src/utils/webpack-utils.ts"],"sourcesContent":["import * as path from \"path\"\nimport { RuleSetRule, WebpackPluginInstance } from \"webpack\"\nimport { GraphQLSchema } from \"graphql\"\nimport { Plugin as PostCSSPlugin } from \"postcss\"\nimport autoprefixer from \"autoprefixer\"\nimport flexbugs from \"postcss-flexbugs-fixes\"\nimport TerserPlugin from \"terser-webpack-plugin\"\nimport type { MinifyOptions as TerserOptions } from \"terser\"\nimport MiniCssExtractPlugin from \"mini-css-extract-plugin\"\nimport CssMinimizerPlugin from \"css-minimizer-webpack-plugin\"\nimport ReactRefreshWebpackPlugin from \"@pmmmwh/react-refresh-webpack-plugin\"\nimport { getBrowsersList } from \"./browserslist\"\nimport ESLintPlugin from \"eslint-webpack-plugin\"\nimport { cpuCoreCount } from \"gatsby-core-utils\"\nimport { GatsbyWebpackStatsExtractor } from \"./gatsby-webpack-stats-extractor\"\nimport {\n GatsbyWebpackVirtualModules,\n VIRTUAL_MODULES_BASE_PATH,\n} from \"./gatsby-webpack-virtual-modules\"\n\nimport { builtinPlugins } from \"./webpack-plugins\"\nimport { IProgram, Stage } from \"../commands/types\"\nimport { eslintConfig, eslintRequiredConfig } from \"./eslint-config\"\nimport { store } from \"../redux\"\nimport type { RuleSetUseItem } from \"webpack\"\nimport { ROUTES_DIRECTORY } from \"../constants\"\n\ntype Loader = string | { loader: string; options?: { [name: string]: any } }\ntype LoaderResolver<T = Record<string, unknown>> = (options?: T) => Loader\n\ntype LoaderOptions = Record<string, any>\ntype RuleFactory<T = Record<string, unknown>> = (\n options?: T & LoaderOptions\n) => RuleSetRule\n\ntype ContextualRuleFactory<T = Record<string, unknown>> = RuleFactory<T> & {\n internal?: RuleFactory<T>\n external?: RuleFactory<T>\n}\n\ntype PluginFactory = (...args: any) => WebpackPluginInstance | null\n\ntype BuiltinPlugins = typeof builtinPlugins\n\ntype CSSModulesOptions =\n | boolean\n | string\n | {\n mode?:\n | \"local\"\n | \"global\"\n | \"pure\"\n | ((resourcePath: string) => \"local\" | \"global\" | \"pure\")\n auto?: boolean\n exportGlobals?: boolean\n localIdentName?: string\n localIdentContext?: string\n localIdentHashPrefix?: string\n namedExport?: boolean\n exportLocalsConvention?:\n | \"asIs\"\n | \"camelCaseOnly\"\n | \"camelCase\"\n | \"dashes\"\n | \"dashesOnly\"\n exportOnlyLocals?: boolean\n }\n\ntype MiniCSSExtractLoaderModuleOptions =\n | undefined\n | boolean\n | {\n namedExport?: boolean\n }\n/**\n * Utils that produce webpack `loader` objects\n */\ninterface ILoaderUtils {\n yaml: LoaderResolver\n style: LoaderResolver\n css: LoaderResolver<{\n url?: boolean | ((url: string, resourcePath: string) => boolean)\n import?:\n | boolean\n | ((url: string, media: string, resourcePath: string) => boolean)\n modules?: CSSModulesOptions\n sourceMap?: boolean\n importLoaders?: number\n esModule?: boolean\n }>\n postcss: LoaderResolver<{\n browsers?: Array<string>\n overrideBrowserslist?: Array<string>\n plugins?: Array<PostCSSPlugin> | ((loader: Loader) => Array<PostCSSPlugin>)\n }>\n\n file: LoaderResolver\n url: LoaderResolver\n js: LoaderResolver\n json: LoaderResolver\n null: LoaderResolver\n raw: LoaderResolver\n dependencies: LoaderResolver\n\n miniCssExtract: LoaderResolver\n imports?: LoaderResolver\n exports?: LoaderResolver\n}\n\ninterface IModuleThatUseGatsby {\n name: string\n path: string\n}\n\ntype CssLoaderModuleOption = boolean | Record<string, any> | string\n\n/**\n * Utils that produce webpack rule objects\n */\ninterface IRuleUtils {\n /**\n * Handles JavaScript compilation via babel\n */\n js: RuleFactory<{ modulesThatUseGatsby?: Array<IModuleThatUseGatsby> }>\n dependencies: RuleFactory<{\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n }>\n yaml: RuleFactory\n fonts: RuleFactory\n images: RuleFactory\n miscAssets: RuleFactory\n media: RuleFactory\n\n css: ContextualRuleFactory<{\n browsers?: Array<string>\n modules?: CssLoaderModuleOption\n }>\n cssModules: RuleFactory\n postcss: ContextualRuleFactory<{ overrideBrowserOptions: Array<string> }>\n\n eslint: (schema: GraphQLSchema) => RuleSetRule\n eslintRequired: () => RuleSetRule\n}\n\ntype PluginUtils = BuiltinPlugins & {\n extractText: PluginFactory\n uglify: PluginFactory\n moment: PluginFactory\n extractStats: PluginFactory\n minifyJs: PluginFactory\n minifyCss: PluginFactory\n fastRefresh: PluginFactory\n eslintGraphqlSchemaReload: PluginFactory\n virtualModules: PluginFactory\n eslint: PluginFactory\n eslintRequired: PluginFactory\n}\n\n/**\n * webpack atoms namespace\n */\ninterface IWebpackUtils {\n loaders: ILoaderUtils\n\n rules: IRuleUtils\n\n plugins: PluginUtils\n}\n\nconst vendorRegex = /(node_modules|bower_components)/\n\n/**\n * A factory method that produces an atoms namespace\n */\nexport const createWebpackUtils = (\n stage: Stage,\n program: IProgram\n): IWebpackUtils => {\n const assetRelativeRoot = `static/`\n const supportedBrowsers = getBrowsersList(program.directory)\n\n const PRODUCTION = !stage.includes(`develop`)\n\n const isSSR = stage.includes(`html`)\n const { config } = store.getState()\n\n const makeExternalOnly =\n (original: RuleFactory) =>\n (options = {}): RuleSetRule => {\n const rule = original(options)\n rule.include = vendorRegex\n return rule\n }\n\n const makeInternalOnly =\n (original: RuleFactory) =>\n (options = {}): RuleSetRule => {\n const rule = original(options)\n rule.exclude = vendorRegex\n return rule\n }\n\n const fileLoaderCommonOptions: {\n name: string\n publicPath?: string\n outputPath?: string\n } = {\n name: `${assetRelativeRoot}[name]-[hash].[ext]`,\n }\n\n if (stage === `build-html` || stage === `develop-html`) {\n // build-html and develop-html outputs to `.cache/page-ssr/routes/` (ROUTES_DIRECTORY)\n // so this config is setting it to output assets to `public` (outputPath)\n // while preserving \"url\" (publicPath)\n fileLoaderCommonOptions.outputPath = path.relative(\n ROUTES_DIRECTORY,\n `public`\n )\n fileLoaderCommonOptions.publicPath = `/`\n }\n\n const loaders: ILoaderUtils = {\n json: (options = {}) => {\n return {\n options,\n loader: require.resolve(`json-loader`),\n }\n },\n yaml: (options = {}) => {\n return {\n loader: require.resolve(`yaml-loader`),\n options: {\n asJSON: true,\n ...options,\n },\n }\n },\n\n null: (options = {}) => {\n return {\n options,\n loader: require.resolve(`null-loader`),\n }\n },\n\n raw: (options = {}) => {\n return {\n options,\n loader: require.resolve(`raw-loader`),\n }\n },\n\n style: (options = {}) => {\n return {\n options,\n loader: require.resolve(`style-loader`),\n }\n },\n\n // TODO(v5): Re-Apply https://github.com/gatsbyjs/gatsby/pull/33979 with breaking change in inline loader syntax\n miniCssExtract: (\n options: {\n modules?: MiniCSSExtractLoaderModuleOptions\n } = {}\n ) => {\n let moduleOptions: MiniCSSExtractLoaderModuleOptions = undefined\n\n const { modules, ...restOptions } = options\n\n if (typeof modules === `boolean` && options.modules) {\n moduleOptions = {\n namedExport: true,\n }\n } else {\n moduleOptions = modules\n }\n\n return {\n loader: MiniCssExtractPlugin.loader,\n options: {\n modules: moduleOptions,\n ...restOptions,\n },\n }\n },\n\n css: (options = {}) => {\n let modulesOptions: CSSModulesOptions = false\n if (options.modules) {\n modulesOptions = {\n auto: undefined,\n namedExport: true,\n localIdentName: `[name]--[local]--[hash:hex:5]`,\n exportLocalsConvention: `dashesOnly`,\n exportOnlyLocals: isSSR,\n }\n\n if (typeof options.modules === `object`) {\n modulesOptions = {\n ...modulesOptions,\n ...options.modules,\n }\n }\n }\n\n return {\n loader: require.resolve(`css-loader`),\n options: {\n // Absolute urls (https or //) are not send to this function. Only resolvable paths absolute or relative ones.\n url: function (url: string): boolean {\n // When an url starts with /\n if (url.startsWith(`/`)) {\n return false\n }\n\n return true\n },\n sourceMap: !PRODUCTION,\n modules: modulesOptions,\n },\n }\n },\n\n postcss: (options = {}) => {\n const {\n plugins,\n overrideBrowserslist = supportedBrowsers,\n ...postcssOpts\n } = options\n\n return {\n loader: require.resolve(`postcss-loader`),\n options: {\n execute: false,\n sourceMap: !PRODUCTION,\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n postcssOptions: (loaderContext: any) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let postCSSPlugins: Array<PostCSSPlugin> = []\n if (plugins) {\n postCSSPlugins =\n typeof plugins === `function` ? plugins(loaderContext) : plugins\n }\n\n const autoprefixerPlugin = autoprefixer({\n overrideBrowserslist,\n flexbox: `no-2009`,\n ...((\n postCSSPlugins.find(\n plugin => plugin.postcssPlugin === `autoprefixer`\n ) as unknown as autoprefixer.ExportedAPI\n )?.options ?? {}),\n })\n\n postCSSPlugins.unshift(autoprefixerPlugin)\n postCSSPlugins.unshift(flexbugs)\n\n return {\n plugins: postCSSPlugins,\n ...postcssOpts,\n }\n },\n },\n }\n },\n\n file: (options = {}) => {\n return {\n loader: require.resolve(`file-loader`),\n options: {\n ...fileLoaderCommonOptions,\n ...options,\n },\n }\n },\n\n url: (options = {}) => {\n return {\n loader: require.resolve(`url-loader`),\n options: {\n limit: 10000,\n ...fileLoaderCommonOptions,\n fallback: require.resolve(`file-loader`),\n ...options,\n },\n }\n },\n\n js: options => {\n return {\n options: {\n stage,\n reactRuntime: config.jsxRuntime,\n reactImportSource: config.jsxImportSource,\n cacheDirectory: path.join(\n program.directory,\n `.cache`,\n `webpack`,\n `babel`\n ),\n ...options,\n rootDir: program.directory,\n },\n loader: require.resolve(`./babel-loader`),\n }\n },\n\n dependencies: options => {\n return {\n options: {\n cacheDirectory: path.join(\n program.directory,\n `.cache`,\n `webpack`,\n `babel`\n ),\n ...options,\n },\n loader: require.resolve(`babel-loader`),\n }\n },\n }\n\n /**\n * Rules\n */\n const rules = {} as IRuleUtils\n\n /**\n * JavaScript loader via babel, includes userland code\n * and packages that depend on `gatsby`\n */\n {\n const js = ({\n modulesThatUseGatsby = [],\n ...options\n }: {\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n } = {}): RuleSetRule => {\n return {\n test: /\\.(js|mjs|jsx|ts|tsx)$/,\n include: (modulePath: string): boolean => {\n // when it's not coming from node_modules we treat it as a source file.\n if (!vendorRegex.test(modulePath)) {\n return true\n }\n\n // If the module uses Gatsby as a dependency\n // we want to treat it as src so we can extract queries\n return modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n },\n type: `javascript/auto`,\n use: ({ resourceQuery, issuer }): Array<RuleSetUseItem> => [\n // If a JS import comes from async-requires, assume it is for a page component.\n // Using `issuer` allows us to avoid mutating async-requires for this case.\n //\n // If other imports are added to async-requires in the future, another option is to\n // append a query param to page components in the store and check against `resourceQuery` here.\n //\n // This would require we adjust `doesModuleMatchResourcePath` in `static-query-mapper`\n // to check against the module's `resourceResolveData.path` instead of resource to avoid\n // mismatches because of the added query param. Other adjustments may also be needed.\n loaders.js({\n ...options,\n configFile: true,\n compact: PRODUCTION,\n isPageTemplate: /async-requires/.test(issuer),\n resourceQuery,\n }),\n ],\n }\n }\n rules.js = js\n }\n\n /**\n * Node_modules JavaScript loader via babel\n * Excludes core-js & babel-runtime to speedup babel transpilation\n * Excludes modules that use Gatsby since the `rules.js` already transpiles those\n */\n {\n const dependencies = ({\n modulesThatUseGatsby = [],\n }: {\n modulesThatUseGatsby?: Array<IModuleThatUseGatsby>\n } = {}): RuleSetRule => {\n const jsOptions = {\n babelrc: false,\n configFile: false,\n compact: false,\n presets: [\n [\n require.resolve(`babel-preset-gatsby/dependencies`),\n {\n stage,\n },\n ],\n ],\n // If an error happens in a package, it's possible to be\n // because it was compiled. Thus, we don't want the browser\n // debugger to show the original code. Instead, the code\n // being evaluated would be much more helpful.\n sourceMaps: false,\n\n cacheIdentifier: JSON.stringify({\n browsersList: supportedBrowsers,\n gatsbyPreset: require(`babel-preset-gatsby/package.json`).version,\n }),\n }\n\n // TODO REMOVE IN V3\n // a list of vendors we know we shouldn't polyfill (we should have set core-js to entry but we didn't so we have to do this)\n const VENDORS_TO_NOT_POLYFILL = [\n `@babel[\\\\\\\\/]runtime`,\n `@mikaelkristiansson[\\\\\\\\/]domready`,\n `@reach[\\\\\\\\/]router`,\n `babel-preset-gatsby`,\n `core-js`,\n `dom-helpers`,\n `gatsby-legacy-polyfills`,\n `gatsby-link`,\n `gatsby-script`,\n `gatsby-react-router-scroll`,\n `invariant`,\n `lodash`,\n `mitt`,\n `prop-types`,\n `react-dom`,\n `react`,\n `regenerator-runtime`,\n `scheduler`,\n `scroll-behavior`,\n `shallow-compare`,\n `warning`,\n `webpack`,\n ]\n const doNotPolyfillRegex = new RegExp(\n `[\\\\\\\\/]node_modules[\\\\\\\\/](${VENDORS_TO_NOT_POLYFILL.join(\n `|`\n )})[\\\\\\\\/]`\n )\n\n return {\n test: /\\.(js|mjs)$/,\n exclude: (modulePath: string): boolean => {\n // If dep is user land code, exclude\n if (!vendorRegex.test(modulePath)) {\n return true\n }\n\n // If dep uses Gatsby, exclude\n if (\n modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n ) {\n return true\n }\n\n return doNotPolyfillRegex.test(modulePath)\n },\n type: `javascript/auto`,\n use: [loaders.dependencies(jsOptions)],\n }\n }\n rules.dependencies = dependencies\n }\n\n rules.yaml = (): RuleSetRule => {\n return {\n test: /\\.ya?ml$/,\n type: `json`,\n use: [loaders.yaml()],\n }\n }\n\n /**\n * Font loader\n */\n rules.fonts = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(eot|otf|ttf|woff(2)?)(\\?.*)?$/,\n }\n }\n\n /**\n * Loads image assets, inlines images via a data URI if they are below\n * the size threshold\n */\n rules.images = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(ico|svg|jpg|jpeg|png|gif|webp|avif)(\\?.*)?$/,\n }\n }\n\n /**\n * Loads audio and video and inlines them via a data URI if they are below\n * the size threshold\n */\n rules.media = (): RuleSetRule => {\n return {\n use: [loaders.url()],\n test: /\\.(mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)$/,\n }\n }\n\n /**\n * Loads assets without inlining\n */\n rules.miscAssets = (): RuleSetRule => {\n return {\n use: [loaders.file()],\n test: /\\.pdf$/,\n }\n }\n\n /**\n * CSS style loader.\n */\n {\n const css: IRuleUtils[\"css\"] = (options = {}): RuleSetRule => {\n const { browsers, ...restOptions } = options\n const use = [\n !isSSR && loaders.miniCssExtract(restOptions),\n loaders.css({ ...restOptions, importLoaders: 1 }),\n loaders.postcss({ browsers }),\n ].filter(Boolean) as RuleSetRule[\"use\"]\n\n return {\n use,\n test: /\\.css$/,\n }\n }\n\n /**\n * CSS style loader, _excludes_ node_modules.\n */\n css.internal = makeInternalOnly(css)\n css.external = makeExternalOnly(css)\n\n const cssModules: IRuleUtils[\"cssModules\"] = (options): RuleSetRule => {\n const rule = css({ ...options, modules: true })\n delete rule.exclude\n rule.test = /\\.module\\.css$/\n return rule\n }\n\n rules.css = css\n rules.cssModules = cssModules\n }\n\n /**\n * PostCSS loader.\n */\n {\n const postcss: ContextualRuleFactory = (options): RuleSetRule => {\n return {\n test: /\\.css$/,\n use: [loaders.css({ importLoaders: 1 }), loaders.postcss(options)],\n }\n }\n\n /**\n * PostCSS loader, _excludes_ node_modules.\n */\n postcss.internal = makeInternalOnly(postcss)\n postcss.external = makeExternalOnly(postcss)\n rules.postcss = postcss\n }\n /**\n * cast rules to IRuleUtils\n */\n /**\n * Plugins\n */\n const plugins = { ...builtinPlugins } as PluginUtils\n\n plugins.minifyJs = ({\n terserOptions,\n ...options\n }: {\n terserOptions?: TerserOptions\n } = {}): WebpackPluginInstance =>\n new TerserPlugin({\n exclude: /\\.min\\.js/,\n terserOptions: {\n ie8: false,\n mangle: {\n safari10: true,\n },\n parse: {\n ecma: 5,\n },\n compress: {\n ecma: 5,\n },\n output: {\n ecma: 5,\n },\n ...terserOptions,\n },\n parallel: Math.max(1, cpuCoreCount() - 1),\n ...options,\n })\n\n plugins.minifyCss = (\n options = {\n minimizerOptions: {\n preset: [\n `default`,\n {\n svgo: {\n full: true,\n plugins: [\n // potentially destructive plugins removed - see https://github.com/gatsbyjs/gatsby/issues/15629\n // use correct config format and remove plugins requiring specific params - see https://github.com/gatsbyjs/gatsby/issues/31619\n // List of default plugins and their defaults: https://github.com/svg/svgo#built-in-plugins\n // Last update 2021-08-17\n `cleanupAttrs`,\n `cleanupEnableBackground`,\n `cleanupIDs`,\n `cleanupListOfValues`, // Default: disabled\n `cleanupNumericValues`,\n `collapseGroups`,\n `convertColors`,\n `convertPathData`,\n `convertStyleToAttrs`, // Default: disabled\n `convertTransform`,\n `inlineStyles`,\n `mergePaths`,\n `minifyStyles`,\n `moveElemsAttrsToGroup`,\n `moveGroupAttrsToElems`,\n `prefixIds`, // Default: disabled\n `removeComments`,\n `removeDesc`,\n `removeDoctype`,\n `removeEditorsNSData`,\n `removeEmptyAttrs`,\n `removeEmptyContainers`,\n `removeEmptyText`,\n `removeHiddenElems`,\n `removeMetadata`,\n `removeNonInheritableGroupAttrs`,\n `removeRasterImages`, // Default: disabled\n `removeScriptElement`, // Default: disabled\n `removeStyleElement`, // Default: disabled\n `removeTitle`,\n `removeUnknownsAndDefaults`,\n `removeUnusedNS`,\n `removeUselessDefs`,\n `removeUselessStrokeAndFill`,\n `removeXMLProcInst`,\n `reusePaths`, // Default: disabled\n `sortAttrs`, // Default: disabled\n ],\n },\n },\n ],\n },\n }\n ): CssMinimizerPlugin =>\n new CssMinimizerPlugin({\n parallel: Math.max(1, cpuCoreCount() - 1),\n ...options,\n })\n\n plugins.fastRefresh = ({ modulesThatUseGatsby }): WebpackPluginInstance => {\n const regExpToHack = /node_modules/\n regExpToHack.test = (modulePath: string): boolean => {\n // when it's not coming from node_modules we treat it as a source file.\n if (!vendorRegex.test(modulePath)) {\n return false\n }\n\n // If the module uses Gatsby as a dependency\n // we want to treat it as src because of shadowing\n return !modulesThatUseGatsby.some(module =>\n modulePath.includes(module.path)\n )\n }\n\n return new ReactRefreshWebpackPlugin({\n overlay: {\n sockIntegration: `whm`,\n module: path.join(__dirname, `fast-refresh-module`),\n },\n // this is a bit hacky - exclude expect string or regexp or array of those\n // so this is tricking ReactRefreshWebpackPlugin with providing regexp with\n // overwritten .test method\n exclude: regExpToHack,\n })\n }\n\n plugins.extractText = (options: any): WebpackPluginInstance =>\n new MiniCssExtractPlugin({\n ...options,\n })\n\n plugins.moment = (): WebpackPluginInstance =>\n plugins.ignore({ resourceRegExp: /^\\.\\/locale$/, contextRegExp: /moment$/ })\n\n plugins.extractStats = (): GatsbyWebpackStatsExtractor =>\n new GatsbyWebpackStatsExtractor()\n\n // TODO: remove this in v5\n plugins.eslintGraphqlSchemaReload = (): null => null\n\n plugins.virtualModules = (): GatsbyWebpackVirtualModules =>\n new GatsbyWebpackVirtualModules()\n\n plugins.eslint = (): WebpackPluginInstance => {\n const options = {\n extensions: [`js`, `jsx`],\n exclude: [\n `/node_modules/`,\n `/bower_components/`,\n VIRTUAL_MODULES_BASE_PATH,\n ],\n ...eslintConfig(config.jsxRuntime === `automatic`),\n }\n // @ts-ignore\n return new ESLintPlugin(options)\n }\n\n plugins.eslintRequired = (): WebpackPluginInstance => {\n const options = {\n extensions: [`js`, `jsx`],\n exclude: [\n `/node_modules/`,\n `/bower_components/`,\n VIRTUAL_MODULES_BASE_PATH,\n ],\n ...eslintRequiredConfig,\n }\n // @ts-ignore\n return new ESLintPlugin(options)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;IACA,OAAO,IAAIF,4BAAJ,CAAiBhJ,OAAjB,CAAP;EACD,CAZD;;EAcA,OAAO;IACLY,OADK;IAELsD,KAFK;IAGL3B;EAHK,CAAP;AAKD,CAlqBM"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby",
3
3
  "description": "Blazing fast modern site generator for React",
4
- "version": "4.25.2",
4
+ "version": "4.25.4-alpha-initial-webhook-body.2+455e86ce3f",
5
5
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
6
6
  "bin": {
7
7
  "gatsby": "./cli.js"
@@ -47,8 +47,8 @@
47
47
  "babel-plugin-add-module-exports": "^1.0.4",
48
48
  "babel-plugin-dynamic-import-node": "^2.3.3",
49
49
  "babel-plugin-lodash": "^3.3.4",
50
- "babel-plugin-remove-graphql-queries": "^4.25.0",
51
- "babel-preset-gatsby": "^2.25.0",
50
+ "babel-plugin-remove-graphql-queries": "4.25.0",
51
+ "babel-preset-gatsby": "2.25.0",
52
52
  "better-opn": "^2.1.1",
53
53
  "bluebird": "^3.7.2",
54
54
  "browserslist": "^4.17.5",
@@ -90,20 +90,20 @@
90
90
  "find-cache-dir": "^3.3.2",
91
91
  "fs-exists-cached": "1.0.0",
92
92
  "fs-extra": "^10.1.0",
93
- "gatsby-cli": "^4.25.0",
94
- "gatsby-core-utils": "^3.25.0",
95
- "gatsby-graphiql-explorer": "^2.25.0",
96
- "gatsby-legacy-polyfills": "^2.25.0",
97
- "gatsby-link": "^4.25.0",
98
- "gatsby-page-utils": "^2.25.0",
93
+ "gatsby-cli": "4.25.0",
94
+ "gatsby-core-utils": "3.25.0",
95
+ "gatsby-graphiql-explorer": "2.25.0",
96
+ "gatsby-legacy-polyfills": "2.25.0",
97
+ "gatsby-link": "4.25.0",
98
+ "gatsby-page-utils": "2.25.0",
99
99
  "gatsby-parcel-config": "0.16.0",
100
- "gatsby-plugin-page-creator": "^4.25.0",
101
- "gatsby-plugin-typescript": "^4.25.0",
102
- "gatsby-plugin-utils": "^3.19.0",
103
- "gatsby-react-router-scroll": "^5.25.0",
104
- "gatsby-script": "^1.10.0",
105
- "gatsby-telemetry": "^3.25.0",
106
- "gatsby-worker": "^1.25.0",
100
+ "gatsby-plugin-page-creator": "4.25.0",
101
+ "gatsby-plugin-typescript": "4.25.0",
102
+ "gatsby-plugin-utils": "3.19.0",
103
+ "gatsby-react-router-scroll": "5.25.0",
104
+ "gatsby-script": "1.10.0",
105
+ "gatsby-telemetry": "3.25.0",
106
+ "gatsby-worker": "1.25.0",
107
107
  "glob": "^7.2.3",
108
108
  "globby": "^11.1.0",
109
109
  "got": "^11.8.5",
@@ -195,7 +195,7 @@
195
195
  "@types/string-similarity": "^4.0.0",
196
196
  "@types/tmp": "^0.2.0",
197
197
  "@types/webpack-virtual-modules": "^0.1.1",
198
- "babel-preset-gatsby-package": "^2.25.0",
198
+ "babel-preset-gatsby-package": "2.25.0",
199
199
  "copyfiles": "^2.3.0",
200
200
  "cross-env": "^7.0.3",
201
201
  "documentation": "^13.1.0",
@@ -209,7 +209,7 @@
209
209
  "zipkin-transport-http": "^0.22.0"
210
210
  },
211
211
  "optionalDependencies": {
212
- "gatsby-sharp": "^0.19.0"
212
+ "gatsby-sharp": "0.19.0"
213
213
  },
214
214
  "engines": {
215
215
  "node": ">=14.15.0"
@@ -277,5 +277,5 @@
277
277
  "yargs": {
278
278
  "boolean-negation": false
279
279
  },
280
- "gitHead": "13bf518f95eed9373da0ae93a13ce774a4a3fc17"
280
+ "gitHead": "455e86ce3f9cb88e23f02763bb9f9d9b5a0e1ac7"
281
281
  }