Skip to content

Evaluate Migrating from Webpack (via django-webpack-loader) to Vite in our Django stack #694

@pyanderson

Description

@pyanderson

I’d like to propose evaluating a migration (or partial adoption) from our current Webpack + django-webpack-loader setup to Vite, in order to improve developer experience, build performance, and modern tooling. However, given our Django integration, the migration will require special care and planning.

📌 Context & Constraints (Django + django-webpack-loader)

  • We currently use django-webpack-loader to bridge Django templates with Webpack-built assets, by reading a stats/manifest file and injecting script/css tags at runtime.
  • This coupling means that any replacement must still allow Django to reference built assets (with hashed filenames, splits, etc.).
  • Some Webpack-specific plugins, loaders, or configurations (e.g. custom module resolution, asset handling) may not have direct counterparts in Vite.
  • We also often rely on features such as hot reload / HMR in dev mode, and stable builds in production that mesh with Django’s static file system and collectstatic.
  • So migrating is not a "drop-in swap"; we’ll need to address how Django will consume Vite assets, replace or replicate webpack-loader behavior, and adapt existing pipeline scripts.

✅ Potential Benefits / Pros

  1. Faster development builds & better hot-reload
    • Vite’s dev server with native ES modules can reduce cold-start times and speed up incremental reloads.
    • HMR tends to be more responsive in Vite setups.
  2. Simpler configuration & less boilerplate
    • Vite often requires less configuration for common patterns, reducing long Webpack configs.
    • Many modern features (e.g. code splitting, tree shaking) are built in.
  3. More alignment with modern frontend tools
    • Easier compatibility with ESM-based libraries and tools.
    • Growing ecosystem around Vite / Rollup / plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions