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
This commit is contained in:
Vladimir Razuvaev
2020-08-19 20:12:35 +02:00
committed by GitHub
parent 1cc8aa3f03
commit 81bfee964d
4 changed files with 284 additions and 228 deletions

View File

@@ -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`,
],
},
},
},
{

View File

@@ -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",

View File

@@ -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 Load Diff