TailwindCSS JIT Webpack HMR keeps recompiling with themekit

Viewed 905

I am trying to use TailwindCSS JIT feature in a custom Webpack project with Themekit and when running yarn start the webpack dev server HMR keeps recompiling.

Code: https://github.com/3daddict/themekit-webpack/pull/63

package.json

{
"scripts": {
...
    "start": "TAILWIND_MODE=watch webpack serve --mode=development --config webpack.dev.js",
...
  }
}

tailwind.config.js

module.exports = {
  mode: 'jit',
  purge: {
    enabled: true,
    content: [
      './dist/**/*.liquid',
      './dist/**/*.js',
    ],
  },
  ...
}

src/components/tailwind.css

/* purgecss start ignore */
@tailwind base;
@tailwind components;
/* purgecss end ignore */
@tailwind utilities;
...

The Webpack dev server hot module reloading keeps recompiling over and over. I am stuck trying to figure out what is the cause.

ℹ 「wdm」: webpack compiled successfully
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
ℹ 「wdm」: webpack compiled successfully
ℹ 「wdm」: Compiled successfully.
0 Answers
Related