Skip to content

Commit 81bfee9

Browse files
authored
Fix issues on Windows (reactjs#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
1 parent 1cc8aa3 commit 81bfee9

File tree

4 files changed

+284
-228
lines changed

4 files changed

+284
-228
lines changed

gatsby-config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ module.exports = {
6262
options: {
6363
defaultText: '<b>Try it on CodePen</b>',
6464
directory: `${__dirname}/examples/`,
65-
externals: [
66-
`//unpkg.com/react/umd/react.development.js`,
67-
`//unpkg.com/react-dom/umd/react-dom.development.js`,
68-
],
69-
dependencies: [`react`, `react-dom`],
70-
redirectTemplate: `${__dirname}/src/templates/codepen-example.js`,
7165
target: '_blank',
66+
codepen: {
67+
redirectTemplate: `${__dirname}/src/templates/codepen-example.js`,
68+
externals: [
69+
`//unpkg.com/react/umd/react.development.js`,
70+
`//unpkg.com/react-dom/umd/react-dom.development.js`,
71+
],
72+
},
7273
},
7374
},
7475
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"gatsby-plugin-react-helmet": "^3.0.0",
3030
"gatsby-plugin-sharp": "^2.4.12",
3131
"gatsby-plugin-twitter": "^2.0.0",
32-
"gatsby-remark-code-repls": "^2.0.0",
32+
"gatsby-remark-code-repls": "^3.0.0",
3333
"gatsby-remark-copy-linked-files": "^2.0.0",
3434
"gatsby-remark-embed-snippet": "^3.0.0",
3535
"gatsby-remark-external-links": "^0.0.4",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exports.onCreateNode = async ({actions, node, loadNodeContent}) => {
1919

2020
if (
2121
sourceInstanceName === 'content' &&
22-
relativeDirectory === path.join('home', 'examples') &&
22+
relativeDirectory === 'home/examples' &&
2323
ext === '.js'
2424
) {
2525
const code = await loadNodeContent(node);

0 commit comments

Comments
 (0)