Skip to content

Commit

Permalink
Fix copying "dev-404-page.js" to the cache folder on Windows (#3627)
Browse files Browse the repository at this point in the history
* Fix images disappearing from rendered markdown files

Fixes #3608

* Revert invalid indentation changes

* Fix copying "dev-404-page.js" to the cache folder on Windows

Fixes #2819

* Fix snapshot tests

* Revert invalid improper snapshot test modification
  • Loading branch information
kripod authored and KyleAMathews committed Jan 20, 2018
1 parent df041d5 commit cdd2efc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

exports[`Load plugins Loads plugins defined with an object but without an option key 1`] = `
Array [
Object {
"id": "Plugin dev-404-page",
"name": "dev-404-page",
"nodeAPIs": Array [
"createPages",
],
"pluginOptions": Object {
"plugins": Array [],
},
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin component-page-creator",
"name": "component-page-creator",
Expand Down Expand Up @@ -39,18 +51,6 @@ Array [
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin dev-404-page",
"name": "dev-404-page",
"nodeAPIs": Array [
"createPages",
],
"pluginOptions": Object {
"plugins": Array [],
},
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin prod-404",
"name": "prod-404",
Expand Down Expand Up @@ -99,6 +99,18 @@ Array [

exports[`Load plugins load plugins for a site 1`] = `
Array [
Object {
"id": "Plugin dev-404-page",
"name": "dev-404-page",
"nodeAPIs": Array [
"createPages",
],
"pluginOptions": Object {
"plugins": Array [],
},
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin component-page-creator",
"name": "component-page-creator",
Expand Down Expand Up @@ -136,18 +148,6 @@ Array [
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin dev-404-page",
"name": "dev-404-page",
"nodeAPIs": Array [
"createPages",
],
"pluginOptions": Object {
"plugins": Array [],
},
"resolve": "",
"version": "1.0.0",
},
Object {
"id": "Plugin prod-404",
"name": "prod-404",
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby/src/bootstrap/load-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ module.exports = async (config = {}) => {
}

// Add internal plugins
plugins.push(
processPlugin(path.join(__dirname, `../internal-plugins/dev-404-page`))
)
plugins.push(
processPlugin(
path.join(__dirname, `../internal-plugins/component-page-creator`)
Expand All @@ -148,9 +151,6 @@ module.exports = async (config = {}) => {
path.join(__dirname, `../internal-plugins/internal-data-bridge`)
)
)
plugins.push(
processPlugin(path.join(__dirname, `../internal-plugins/dev-404-page`))
)
plugins.push(
processPlugin(path.join(__dirname, `../internal-plugins/prod-404`))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.createPages = async ({ store, boundActionCreators }) => {
const currentPath = path.join(__dirname, `./raw_dev-404-page.js`)
const newPath = path.join(program.directory, `.cache`, `dev-404-page.js`)

fs.copySync(currentPath, newPath)
await fs.copy(currentPath, newPath)

createPage({
component: newPath,
Expand Down

0 comments on commit cdd2efc

Please sign in to comment.