Skip to content

Conversation

@pomber
Copy link
Contributor

@pomber pomber commented May 1, 2025

Fix #490

To use codehike remark and recma plugins with Turbopack:

npm i remark-codehike recma-codehike

And in your next.config.mjs:

import createMDX from "@next/mdx"

/** @type {import('next').NextConfig} */
const nextConfig = {
  pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
}

/** @type {import('codehike/mdx').CodeHikeConfig} */
const chConfig = {
  components: { code: "Code" },
}

const withMDX = createMDX({
  extension: /\.mdx?$/,
  options: {
    remarkPlugins: [["remark-codehike", chConfig]],
    recmaPlugins: [["recma-codehike", chConfig]],
  },
})

export default withMDX(nextConfig)

This doesn't work on Windows, but it's not related to codehike, it's a Next.js bug.

@vercel
Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
codehike.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 9:12am

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2025

Try codehike from this pull request in your project with:

npm i https://pkg.pr.new/codehike@513

@github-actions github-actions bot added the changeset PR including changesets label May 1, 2025
@pomber pomber merged commit 0733cfc into next May 1, 2025
4 checks passed
@pomber pomber deleted the turbopack branch May 1, 2025 09:16
@github-actions github-actions bot removed the changeset PR including changesets label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage with Turbopack

2 participants