Is there a way to prevent django-pipeline from creating new jsx files every time it compiles react.js code?


I currently have the PyReact JSX compiler installed using django-pipeline.

Whenever I run collectstatic on my files, rather than overwriting a prior version of my react .jsx and compiled .js files, it creates a new version in the same folder. Is there a way to stop this and have the program simply overwrite the prior version? Or, is the best practice for using django-pipeline to use it only once?



    'bootstrap': {
        'source_filenames': (
        'output_filename': 'js/b.js',
    'clubs': {
        'source_filenames': (
        'output_filename': 'js/clubs.js',
    'react': {
        'source_filenames': (
        'output_filename': 'js/r.js',
    'jquery': {
        'source_filenames': (
        'output_filename': 'js/jq.js',

STATIC_ROOT = BASE_DIR + '/static/'

STATIC_URL = '/static/'



If I understand your question correctly, your concern is that after running collectstatic, you have files like foo.2d32ed.js, foo.4bhf45.js, foo.09d9fg.js in your STATIC_ROOT directory.

If so, then this isn’t an issue with PyReact or even with django-pipeline; this is occurring because you’re using a cached storage backend (i.e. your STATICFILES_STORAGE setting). The string appended to your filename is a hash of the file’s contents, which effectively acts like versioning of your static files.

The reason for this is cache-busting on browsers. With filenames as functions of the file’s contents, a browser can cache the file forever, which will speed up page load times for your users on subsequent visits.

If you want to disable this behavior, you can use a non-caching storage backend like PipelineStorage instead.

Here’s some documentation that may help:

Answered By – Kunal Mehta

Answer Checked By – Jay B. (AngularFixing Admin)

Leave a Reply

Your email address will not be published.