SRGSSR / pillarbox-web

Pillarbox is a versatile media playback ecosystem engineered for the web.
https://srgssr.github.io/pillarbox-web-demo/
MIT License
11 stars 1 forks source link

Error Resolving Video.js CSS in Pillarbox Theme #202

Closed jboix closed 6 months ago

jboix commented 6 months ago

I am encountering difficulties integrating Pillarbox into a TypeScript project created with Parcel. The problem arises when attempting to include the CSS file using the following code snippet:

<link rel="stylesheet" href="npm:@srgssr/pillarbox-web/dist/pillarbox.min.css"/>

This triggers the following error message:

🚨 @parcel/core: Failed to resolve '../node_modules/video.js/dist/video-js.css' 
from './node_modules/@srgssr/pillarbox-web/dist/pillarbox.min.css'

Currently, the Video.js CSS is imported within the Pillarbox theme like this:

https://github.com/SRGSSR/pillarbox-web/blob/8353dd8e7d7943d3a9f3ea5b171ac71c31f59116/scss/pillarbox.scss#L1

To bundle the CSS together with the theme, it would be necessary to remove the .css suffix from the import statement:

@import '../node_modules/video.js/dist/video-js';

Additionally, here are some alternative suggestions:

  1. Remove Import and Inform Integrators: Remove the import statement and advise integrators to individually import both Video.js and the Pillarbox theme in their project.

  2. Import Video.js SCSS from video.js/src/css/vjs.scss: Consider importing the Video.js SCSS directly from video.js/src/css/vjs.scss instead of relying on the current approach.

github-actions[bot] commented 6 months ago

:tada: This issue has been resolved in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: