Browse Source

Fix issues on Windows (#3213)

* Upgrade gatsby-remark-code-repls

* fix path issue on Windows

Gatsby uses `slash` to normalize paths. Because of this `path.join` causes an issue on Windows
main
Vladimir Razuvaev 5 years ago
committed by GitHub
parent
commit
81bfee964d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      gatsby-config.js
  2. 2
      package.json
  3. 2
      plugins/gatsby-transformer-home-example-code/gatsby-node.js
  4. 495
      yarn.lock

13
gatsby-config.js

@ -62,13 +62,14 @@ module.exports = {
options: {
defaultText: '<b>Try it on CodePen</b>',
directory: `${__dirname}/examples/`,
externals: [
`//unpkg.com/react/umd/react.development.js`,
`//unpkg.com/react-dom/umd/react-dom.development.js`,
],
dependencies: [`react`, `react-dom`],
redirectTemplate: `${__dirname}/src/templates/codepen-example.js`,
target: '_blank',
codepen: {
redirectTemplate: `${__dirname}/src/templates/codepen-example.js`,
externals: [
`//unpkg.com/react/umd/react.development.js`,
`//unpkg.com/react-dom/umd/react-dom.development.js`,
],
},
},
},
{

2
package.json

@ -29,7 +29,7 @@
"gatsby-plugin-react-helmet": "^3.0.0",
"gatsby-plugin-sharp": "^2.4.12",
"gatsby-plugin-twitter": "^2.0.0",
"gatsby-remark-code-repls": "^2.0.0",
"gatsby-remark-code-repls": "^3.0.0",
"gatsby-remark-copy-linked-files": "^2.0.0",
"gatsby-remark-embed-snippet": "^3.0.0",
"gatsby-remark-external-links": "^0.0.4",

2
plugins/gatsby-transformer-home-example-code/gatsby-node.js

@ -19,7 +19,7 @@ exports.onCreateNode = async ({actions, node, loadNodeContent}) => {
if (
sourceInstanceName === 'content' &&
relativeDirectory === path.join('home', 'examples') &&
relativeDirectory === 'home/examples' &&
ext === '.js'
) {
const code = await loadNodeContent(node);

495
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save