For hours I'm trying to figure out what prevents BrowserSync from injecting CSS changes into the browser. I've got a DDEV setup with Wordpress running on https://wordpress.ddev.site/. I changed the proxy in local.json to the host URL and ran npm run dev. When opening localhost:3000 I see BrowserSync is connect and injecting HTML changes, for example when I change one of the CSS classes (bg-indigo) in templates/partials/example.php to bg-indigo-200.
I expected the CSS in build/css/app.css to change too, as the original file contains .bg-indigo-700 which should now be .bg-indigo-200.
Should the npm command also generate the needed CSS before injecting it into the browser?
Steps I took to try to solve the issue
- Adding a host parameter to the BrowserSync config in
webpack.mix.js
- Exposing port 3000 in DDEV docker compose yaml
- Running the
npm run dev command from within the container
- Delete the
build/css/app.css file after running npm run dev. No file was generated when editing a HTML CSS class.
[EDIT]
I figured this has something to do with de mode: jit parameter in tailwind.js. When disabling the Sass is generated and reloading the page in the browser actually displays the correct result, although injecting the CSS does still not seem to work properly.
For hours I'm trying to figure out what prevents BrowserSync from injecting CSS changes into the browser. I've got a DDEV setup with Wordpress running on https://wordpress.ddev.site/. I changed the proxy in
local.jsonto the host URL and rannpm run dev. When openinglocalhost:3000I see BrowserSync is connect and injecting HTML changes, for example when I change one of the CSS classes (bg-indigo) intemplates/partials/example.phptobg-indigo-200.I expected the CSS in
build/css/app.cssto change too, as the original file contains.bg-indigo-700which should now be.bg-indigo-200.Should the npm command also generate the needed CSS before injecting it into the browser?
Steps I took to try to solve the issue
webpack.mix.jsnpm run devcommand from within the containerbuild/css/app.cssfile after runningnpm run dev. No file was generated when editing a HTML CSS class.[EDIT]
I figured this has something to do with de
mode: jitparameter intailwind.js. When disabling the Sass is generated and reloading the page in the browser actually displays the correct result, although injecting the CSS does still not seem to work properly.