Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwindcss: watch .blade.php changes #3385

Open
AdamReznicek opened this issue Feb 23, 2024 · 1 comment
Open

Tailwindcss: watch .blade.php changes #3385

AdamReznicek opened this issue Feb 23, 2024 · 1 comment

Comments

@AdamReznicek
Copy link

I have issue with my dev stack.

I am using laravel webpack.mix.js and tailwindcss + sass.
My issue is that I need call sass task after .blade.php changed for tailwind compiling.

Default behavior is that when I save the .blade.php, browsersync only reload browser window without sass, postcss compiling.
Can you help me?

This is my webpack.mix.js file:

const mix = require('laravel-mix');
require('laravel-mix-tailwind');
// or const tailwindcss = require('tailwindcss')

mix.js('resources/assets/js/app-front.js', 'public/js')
.sass('resources/assets/sass/app-front.scss', 'public/css')
.tailwind()
.sourceMaps()
.options({
  processCssUrls: false,
  // postCss: [ tailwindcss('./tailwind.config.js') ],
})
.version()
.browserSync({
  proxy: 'cee.local',
  injectChanges: true,
  files: [
      "public/css/app-front.css",
      "public/js/app-front.js",
      "public/js/vendors.js",
      "public/images/**/*",
      // "resources/lang/**/*",
      // "resources/views/**/*.blade.php",
      {
        match: ["resources/views/**/*.blade.php",],
        fn: function (event, file) {
          console.log('php changes');
          mix.tailwind(); // launch tailwind
        },
      },      
  ],  
});
@AdamReznicek
Copy link
Author

No one with same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant