There is one trouble: Webpack assumes it's own subtree of assets to
process, while Django loads assets from packages (Django apps) directories.
I still haven't seen a successful setup of webpack which would respect
loading assets from Django packages directories.
Another trouble, not everyone wants to carry node.js subsystem with it's
huge list of packages in their Python / Django project.
But there are changes that transpiling would not be required in the future
at all, after IE11 would fade to the past:
https://www.freecodecamp.org/news/you-might-not-need-to-transpile-your-javascript-4d5e0a438ca/

On Tue, Dec 22, 2020 at 1:20 PM Adam Johnson <m...@adamj.eu> wrote:

> django-compressor is also popular:
> https://pypi.org/project/django-compressor/
>
> IMO we should not include anything in Django since JavaScript is a
> separate language, and they have much better tools for minification and
> bundling, and these tools can move faster than and orthogonally to Django.
> And there are many options: Webpack, Parcel, Gulp, Grunt, Rollup, ..
>
> On Tue, 22 Dec 2020 at 10:06, quest...@gmail.com <questpc...@gmail.com>
> wrote:
>
>> There is CSS / Javascript merge and compress package for Python:
>> https://github.com/miracle2k/webassets
>> which supports Django, Flask, Pyramid.
>>
>> See also:
>>
>> https://www.slideshare.net/__amol__/pyconit7-dukpy-webassets-free-yourself-from-nodejs-chains
>> https://pypi.org/project/dukpy/
>> https://gist.github.com/amol-/0fd016bbb0c6c9a0fb6ab5bbedfcb7ad
>> https://github.com/rclmenezes/webassets-rollup
>>
>>
>> On Tuesday, December 22, 2020 at 5:03:54 AM UTC+3 arvind...@gmail.com
>> wrote:
>>
>>> I kinda like the idea of being able to run collectstatic and not have to
>>> worry about setting up a full on frontend workflow for pretty much just
>>> minification. It is a great default to have when this is all you need.
>>>
>>> That said, I’d be more interested in seeing something like an official
>>> or a django-blessed unofficial default option similar to the
>>> sprokects-rails gem for ruby. Allowing for a much more flexible and
>>> extensive frontend pipeline without having to rely on an external task
>>> runner.
>>>
>>> On 22 Dec 2020, at 7:24, Diptesh Choudhuri wrote:
>>>
>>> The default files copied to STATIC_ROOT when you run python manage.py
>>> collectstatic should have two versions- file.js and file.min.js (similarly
>>> for css files). As far as I can see, this happens only for the preinstalled
>>> apps (like admin/actions.min.js) but not for user installed apps.
>>> Serbing minified static files is important for all production
>>> environments for pretty much everyone who uses vanilla django. Though there
>>> are packages out there to do this, I feel it is important enough and has
>>> enough use cases to be added to the django core.
>>>
>>> I can start working on this if it is accepted.
>>> Let me know what you think!
>>>
>>> Best
>>> Diptesh Choudhuri
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-develop...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/5bcb1522-3486-452e-b061-2cce2bb6d2c9n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/5bcb1522-3486-452e-b061-2cce2bb6d2c9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/b4ee304c-6861-417c-a20c-bf79b5e2d9efn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-developers/b4ee304c-6861-417c-a20c-bf79b5e2d9efn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Adam
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-developers/dZDRivF29po/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM2xcYM9M1AB-ZK47V4JHH0mNoYvXntz8-wrbzxdOJ1QFg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-developers/CAMyDDM2xcYM9M1AB-ZK47V4JHH0mNoYvXntz8-wrbzxdOJ1QFg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAC5UD1xbCfqv-sLs1p%3D%2BgnVp8k454VtOwP80qAw3H1y7WBUuWw%40mail.gmail.com.

Reply via email to