gatsby-remark-embedded-codesandbox icon indicating copy to clipboard operation
gatsby-remark-embedded-codesandbox copied to clipboard

Allow recursive folders

Open guyathomas opened this issue 4 years ago • 0 comments
trafficstars

Problem

The current plugin only supports a flat list of files, i.e.

App.tsx
index.ts
styles.css
Clock // Will break on build here
- Clock.tsx

Solution

This PR introduces getAllFiles to traverse the filesystem recursively, and build up the relative path filename for the nested files. Note: Also adds in ignoredFiles as part of the options, since in my testing it'd often include things like yarn.lock which would actually mean the generated URL was too long to be supported by codesandbox.

guyathomas avatar Mar 19 '21 02:03 guyathomas