AccordBox / python-webpack-boilerplate

Django Webpack boilerplate & Flask Webpack boilerplate
https://python-webpack-boilerplate.rtfd.io
MIT License
169 stars 20 forks source link

[Question] can this be used with asset managers such as django-compressors #16

Closed simkimsia closed 2 years ago

simkimsia commented 2 years ago

there's a big list https://djangopackages.org/grids/g/asset-managers/

and I am looking at https://django-compressor.readthedocs.io/en/stable/

Can this be used with any of these or it's competing for the same job?

michael-yin commented 2 years ago

@simkimsia

Yes, this can be used with https://django-compressor.readthedocs.io/en/stable/

But I do not recommend you to do it (if you have a project which already use django-compressor, then you can do it)

Try to use frontend tool to do bundle work because django-compressor CAN NOT

  1. Help you lint JS, CSS code
  2. Auto reload web page if JS or CSS code update.
  3. Do code splitting

Thx.

simkimsia commented 2 years ago

Thanks for quick response

What would be your end to end compress/bundle setup for frontend assets of a new django 3.2 project?

No frontend headless architecture. At most use something like htmx and django-components library

michael-yin commented 2 years ago

@simkimsia

Now I use Webpack as bundle solution for my frontend project.

The frontend project usually contains JS, SCSS, CSS, images.

I recommend you to take a look at Alpine.js and https://github.com/AccordBox/django-tailwind-alpine-htmx , actually, I think many Django developers should learn Alpine.js before HTMX

Thx.

simkimsia commented 2 years ago

Oh that's a useful project.

Follow up question

I like to setup a pattern library inside django with components

using https://torchbox.github.io/django-pattern-library/ for the pattern library and https://pypi.org/project/django-components/ for the components.

Would these work with htmx, alpine.js and your webpack boilerplate?

michael-yin commented 2 years ago

@simkimsia

Yes, they can work together.