This library reduces boilerplate for surfacing links in remix.run projects.
npm install remix-surfacing-links
import surfaceLinks from "remix-surfacing-links";
export const links = surfaceLinks({
rel: "stylesheet",
href: require("./styles.css"),
});
You can import children links this way:
import surfaceLinks from "remix-surfacing-links";
export const links = surfaceLinks(
require("~/components/Button"),
require("~/components/Toggle"),
require("~/components/Modal"),
{
rel: "stylesheet",
href: require("~/styles/homepage.css"),
}
);