Back to feed
Dev.to
Dev.to
5/9/2026
I shipped a video player to npm — twice. What I learned about scoped CSS, "use client", and Nuxt modules.

I shipped a video player to npm — twice. What I learned about scoped CSS, "use client", and Nuxt modules.

Short summary

Developer built and shipped a scoped HLS video player as npm packages for both React and Vue (MIT licensed, under 4KB gzipped each). Three key lessons: scope CSS to a single root class to prevent global side-effects; preserve "use client" directives through bundling with Rollup plugin for Next.js App Router compatibility; use Nuxt subpath exports to prevent Node-only modules from browser bundles.

  • Published MIT-licensed video player npm packages (@glitchlab/react-video-player and @glitchlab/vue-video-player) under 4KB gzipped
  • Solved CSS scoping by hand-writing scoped styles under a single root class, eliminating Tailwind preflight and global conflicts
  • Preserved "use client" directives through bundling with custom Rollup plugin for Next.js App Router compatibility

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more