plone / plone.staticresources

Static resources for Plone
https://pypi.org/project/plone.staticresources/
5 stars 12 forks source link

Compiled JavaScript files contain system paths #195

Closed pgrunewald closed 2 years ago

pgrunewald commented 2 years ago

The compiled JavaScript files contain the current working directory of the time of compilation - see this example (taken from demo.plone.org):

define("/home/_thet/data/dev/plone/buildout.coredev/src/plone.staticresources/src/plone/staticresources/static/plone-moment.js",function(){})

The module name within the define statement does not hold any value in the way Plone is using it and can be therefor removed as well. Other than that it is always good to avoid leaking system-specific information to public. Especially when running compile-plone-resources on the same machine serving the Plone site.

I propose to omit this current working directory in the same vein it is done for CSS files in _generate_gruntfile.py.

The result will look then like this:

define("/src/plone.staticresources/src/plone/staticresources/static/plone-moment.js",function(){})

I'll prepare two PRs for both 1.x and master. Let me know if there are other things to be taken care in this regard.

best, Paul

pgrunewald commented 2 years ago

My PR has been merged (1.x). Kudos for that. :) Closing the ticket.