We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edce092 commit e9d854cCopy full SHA for e9d854c
e2e-tests/production-runtime/gatsby-config.js
@@ -2,6 +2,23 @@ const {
2
data: headFunctionExportData,
3
} = require(`./shared-data/head-function-export.js`)
4
5
+try {
6
+ require(`node:path`)
7
+} catch (e) {
8
+ console.warn(
9
+ `Used node version doesn't support "node:" imports protocol, adding polyfill`
10
+ )
11
+
12
+ const mod = require("module")
13
+ const originalModuleLoad = mod._load
14
+ mod._load = (request, parent, isMain) => {
15
+ if (request.startsWith(`node:`)) {
16
+ request = request.replace(`node:`, ``)
17
+ }
18
+ return originalModuleLoad(request, parent, isMain)
19
20
+}
21
22
module.exports = {
23
siteMetadata: {
24
title: `Gatsby Default Starter`,
0 commit comments