mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.52k stars 459 forks source link

Duplicate compiled code #927

Open KyleMaas opened 7 months ago

KyleMaas commented 7 months ago

Describe the issue So, in trying to debug #926, I found that this code:

https://github.com/mediacms-io/mediacms/blob/main/frontend/src/static/js/components/video-player/VideoPlayer.jsx

Ends up being compiled and included as both static/js/_commons.js and static/js/media.js. Not sure why it's duplicated but that's a bunch of extra code that doesn't need to be downloaded twice.

To Reproduce Steps to reproduce the issue:

  1. Add some kind of unique code to frontend/src/static/js/components/video-player/VideoPlayer.jsx like console.log("This shouldn't be here twice")
  2. Rebuild the frontend
  3. In a browser, navigate to a video. Notice that both files are downloaded, and both contain your unique code from step 1

Expected behavior Code shouldn't be duplicated across both files.

Environment (please complete the following information):