Skip to content

Commit c1bfd74

Browse files
kripodjastack
authored andcommitted
Fix copying "dev-404-page.js" to the cache folder on Windows (gatsbyjs#3627)
* Fix images disappearing from rendered markdown files Fixes gatsbyjs#3608 * Revert invalid indentation changes * Fix copying "dev-404-page.js" to the cache folder on Windows Fixes gatsbyjs#2819 * Fix snapshot tests * Revert invalid improper snapshot test modification
1 parent 6b87e0d commit c1bfd74

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

packages/gatsby/src/bootstrap/__tests__/__snapshots__/load-plugins.js.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
exports[`Load plugins Loads plugins defined with an object but without an option key 1`] = `
44
Array [
5+
Object {
6+
"id": "Plugin dev-404-page",
7+
"name": "dev-404-page",
8+
"nodeAPIs": Array [
9+
"createPages",
10+
],
11+
"pluginOptions": Object {
12+
"plugins": Array [],
13+
},
14+
"resolve": "",
15+
"version": "1.0.0",
16+
},
517
Object {
618
"id": "Plugin component-page-creator",
719
"name": "component-page-creator",
@@ -39,18 +51,6 @@ Array [
3951
"resolve": "",
4052
"version": "1.0.0",
4153
},
42-
Object {
43-
"id": "Plugin dev-404-page",
44-
"name": "dev-404-page",
45-
"nodeAPIs": Array [
46-
"createPages",
47-
],
48-
"pluginOptions": Object {
49-
"plugins": Array [],
50-
},
51-
"resolve": "",
52-
"version": "1.0.0",
53-
},
5454
Object {
5555
"id": "Plugin prod-404",
5656
"name": "prod-404",
@@ -99,6 +99,18 @@ Array [
9999

100100
exports[`Load plugins load plugins for a site 1`] = `
101101
Array [
102+
Object {
103+
"id": "Plugin dev-404-page",
104+
"name": "dev-404-page",
105+
"nodeAPIs": Array [
106+
"createPages",
107+
],
108+
"pluginOptions": Object {
109+
"plugins": Array [],
110+
},
111+
"resolve": "",
112+
"version": "1.0.0",
113+
},
102114
Object {
103115
"id": "Plugin component-page-creator",
104116
"name": "component-page-creator",
@@ -136,18 +148,6 @@ Array [
136148
"resolve": "",
137149
"version": "1.0.0",
138150
},
139-
Object {
140-
"id": "Plugin dev-404-page",
141-
"name": "dev-404-page",
142-
"nodeAPIs": Array [
143-
"createPages",
144-
],
145-
"pluginOptions": Object {
146-
"plugins": Array [],
147-
},
148-
"resolve": "",
149-
"version": "1.0.0",
150-
},
151151
Object {
152152
"id": "Plugin prod-404",
153153
"name": "prod-404",

packages/gatsby/src/bootstrap/load-plugins.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ module.exports = async (config = {}) => {
133133
}
134134

135135
// Add internal plugins
136+
plugins.push(
137+
processPlugin(path.join(__dirname, `../internal-plugins/dev-404-page`))
138+
)
136139
plugins.push(
137140
processPlugin(
138141
path.join(__dirname, `../internal-plugins/component-page-creator`)
@@ -148,9 +151,6 @@ module.exports = async (config = {}) => {
148151
path.join(__dirname, `../internal-plugins/internal-data-bridge`)
149152
)
150153
)
151-
plugins.push(
152-
processPlugin(path.join(__dirname, `../internal-plugins/dev-404-page`))
153-
)
154154
plugins.push(
155155
processPlugin(path.join(__dirname, `../internal-plugins/prod-404`))
156156
)

packages/gatsby/src/internal-plugins/dev-404-page/gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports.createPages = async ({ store, boundActionCreators }) => {
88
const currentPath = path.join(__dirname, `./raw_dev-404-page.js`)
99
const newPath = path.join(program.directory, `.cache`, `dev-404-page.js`)
1010

11-
fs.copySync(currentPath, newPath)
11+
await fs.copy(currentPath, newPath)
1212

1313
createPage({
1414
component: newPath,

0 commit comments

Comments
 (0)