Use Webpack with HMR in your WordPress theme.

This WordPress starter theme demonstrates the use of Webpack for compiling assets during development. It includes the use of Bootstrap 4's SCSS components and features hot module replacement. HMR is triggered by changes to the source JS and CSS files.

Download

Usage

  1. Install the theme as you would normally install a WordPress theme
  2. Install dependencies with yarn or npm > npm install
    > # or
    > yarn install
  3. Set WP_ENVIRONMENT to "development" in wp-config.php define('WP_ENVIRONMENT', 'development');
  4. Start up webpack in the terminal and watch for changes: > npm run dev
  5. When you are ready to deploy to production, build assets: > npm run build