by ivansavz · 6y ago · 0 comments
Nice. Yeah, sometimes it's easier to get started this way without investing a day in getting webpack working...
When the time comes and you need webpack, then this package has been known to help the integration between the frontend build system (webpack) and django's static file serving functions: https://github.com/owais/django-webpack-loader
Instead I went with vanilla Webpack outputting files into Django `STATIC_ROOT`. That way Webpack is only concerned with producing the files and Django handles the whole file name hashing, compression etc in production.
I've found this to be much, much more straightforward. I'm planning to write a post about it.
> non-standard manifest plugin
I hear you, and this feels weird to me too, but then again node-land needs to talk to Django-land somehow so writing a .json file doesn't seem all that bad way to do it ;)
I hope to get the post out somewhere this week!
If it's just a weekend project, it's also fine to just include some external JS libraries directly.
What I seem to get away with is using Cookiecutter Django's* simple build pipeline based on npm and gulp. It is basically set up from the moment you finish the project initialization. It even comes with live reloading.
The pipeline is based on these files:
https://github.com/pydanny/cookiecutter-django/blob/master/%...
https://github.com/pydanny/cookiecutter-django/blob/master/%...