code-hike / codehike

Build rich content websites with Markdown and React
https://codehike.org
MIT License
4.7k stars 143 forks source link

[scrollycoding] Can't specify nested files #54

Closed pomber closed 3 years ago

pomber commented 3 years ago
const steps = useMdxSteps(
  children,
  {
    preset: {
      customSetup: {
        files: {
          'public/index.html': `...`,
        },
      },
    },
  },
)

Instead of /public/index.html, /publicindex.html is created.

pomber commented 3 years ago

My bad. The customSetup uses Sandpack's file names, so it should start with a slash:

const steps = useMdxSteps(
  children,
  {
    preset: {
      customSetup: {
        files: {
          '/public/index.html': `...`,
        },
      },
    },
  },
)