Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.1k stars 1.51k forks source link

Plugin CSS not served #3792

Closed 1992Sofia closed 3 years ago

1992Sofia commented 3 years ago

Describe the current behavior I wrote a Plugin with some styles but peertube is not serving them.

Steps to reproduce:

  1. Start PeerTube localy with 'npm run dev'
  2. Clone https://framagit.org/framasoft/peertube/peertube-plugin-quickstart/ and add some styles to 'assets/style.css'
    body#custom-css {
    display: none !important;
    }
  3. Install the plugin
  4. Open 'http://localhost:3000/' and clear your cache. The 'body' is still visible.
  5. Open 'http://localhost:3000/api/v1/config/' to check if the API serving your plugin styles in the json.
    {
    ...
    "plugin": {
        "registered": [
            {
                "clientScripts": {...}
            }
        ]
    },
    ...
    }

    Describe the expected behavior

    {
    ...
    "plugin": {
        "registered": [
            {
                "clientScripts": {...},
                "css": {...} <--expected
            }
        ]
    },
    ...
    }

    Additional information Restarting PerTube after the plugin installation did not help in my case.

Chocobozzz commented 3 years ago

Hello,

Please follow the documentation: https://docs.joinpeertube.org/contribute-plugins?id=test-your-plugintheme

Plugin CSS injection cannot work with a dev server. You need to build PeerTube (to have the compiled client files).