The controller only allow files that are declared in the plugin package.json (clientScripts entry).
Describe the solution you would like
I suggest to add a test: if the requested filename ends with ".map", and the part before .map is a known clientScripts, and the .map files exist: serve the file.
If you do so, you can then add this line in your quickstart plugin:
Describe the problem to be solved
When developing a plugin, generated Sourcemap files for client scripts are not accessible to browser.
This is because of this function: https://github.com/Chocobozzz/PeerTube/blob/2a491182e483b97afb1b65c908b23cb48d591807/server/controllers/plugins.ts#L128-L136
The controller only allow files that are declared in the plugin package.json (
clientScripts
entry).Describe the solution you would like
I suggest to add a test: if the requested filename ends with
".map"
, and the part before.map
is a known clientScripts, and the.map
files exist: serve the file.If you do so, you can then add this line in your quickstart plugin:
https://framagit.org/framasoft/peertube/peertube-plugin-quickstart/-/blob/master/scripts/build.js#L8-15