Remix integration #142
chikamichi
started this conversation in
Show and tell
Replies: 2 comments
-
Thank you @chikamichi. Why not use I have an example here: https://github.com/code-hike/examples/blob/main/remix/remix.config.js |
Beta Was this translation helpful? Give feedback.
0 replies
-
Oh, I tried that too, but for some reasons had an issue. Will give it another try => [edit] that works fine too! Let me edit my post ;) It may come in handy running through Remix’s custom logic/scheduling though, upon triggering Also… I totally missed that examples repo 🙈 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Just wanted to share my findings about integrating CodeHike within Remix.
First, in case you (reading this post ;)) don’t know, Remix is using esbuild and has built-in support for MDX, through Remark. Therefore, no need to install anything besides
@code-hike/mdx@next
.Then, one has to edit remix.config.js to register CodeHike as a Remark plugin, and a theme as well. Simply add an
mdx
entry in themodule.exports
— but beware a couple things:Note: about
require
vsimport
: both work equally well (see pomber’s take on the matter below), the only difference is that when usingimport
statements within themdx
’s function, you’ll slightly defer loading, and will trigger Remix’ loading stack, which may come in handy.Note: about not being able to
import
.json as modules: I guess one could work around that by not calling thedev
script (ie.npm run dev
) directly, but rathernpx
and pass the --experimental-json-module option through, to Node.js. Not tested. Ideally Remix would add support for importing .json files as modules.🙏
Beta Was this translation helpful? Give feedback.
All reactions