gatsby-remark-embedded-codesandbox
gatsby-remark-embedded-codesandbox copied to clipboard
Allow recursive folders
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.