Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove require() of CSS and move to a separate import into code #2

Closed
rickyhaswifi opened this issue Jul 4, 2023 · 2 comments
Closed

Comments

@rickyhaswifi
Copy link

rickyhaswifi commented Jul 4, 2023

image

Moving the CSS into a separate import would allow it to load properly on all versions of React.

Using REMIX - https://remix.run/

@oluwatobiss
Copy link
Member

Hi Ricardo. Thanks for raising this issue. The plugin wasn't tested with Remix, but I would love to make it work.

Please clarify what you mean by "Moving the CSS into a separate import."

@oluwatobiss
Copy link
Member

The package now works with Remix!🎉

Note

Add "@codesweetly/react-youtube-playlist" to your remix.config.js file:

/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
  ignoredRouteFiles: ["**/.*"],
+ serverDependenciesToBundle: ["@codesweetly/react-youtube-playlist"],
  serverModuleFormat: "cjs",
  future: {
    v2_dev: true,
    v2_errorBoundary: true,
    v2_headers: true,
    v2_meta: true,
    v2_normalizeFormMethod: true,
    v2_routeConvention: true,
  },
};

By so doing, Remix will transpile and include the package in the server bundle.

You can read more about the configuration option in the official doc or @dan-cooke's issue comment.

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

No branches or pull requests

2 participants