Usage

Template tags

The provided template tags must be loaded before they can be used:

{% load webpack_extras %}

webpack_include

{% webpack_include filename %}

Includes a file from the Webpack manifest. Only JS and CSS files are currently supported.

Example:

{% load webpack_extras app.js %}

Management commands

runserver

$ django-admin runserver

If settings.DEBUG is True, this runs webpack with --env.development --mode=development.

collectstatic

$ django-admin collectstatic

If settings.DEBUG is True, this runs webpack with --env.development --mode=development.

Otherwise, it runs webpack with --env.production --mode=production.

webpack

$ django-admin webpack

This command runs webpack. By default, it uses a development environment.

Options:

--environment

Selects a build environment. It can be set to production or development.