question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mix.styles() is excluded in emitted output list also watcher ignores mix.styles

See original GitHub issue
  • Laravel Mix Version: 0.12.1
  • Node Version: 7.10.0
  • NPM Version: 4.6.1
  • OS: Ubuntu : 14.04

Description:

I installed fresh Laravel 5.4 application. Added simple code to webpack.mix.js for combining plain css, which is given below in steps. When I run npm run dev everything goes well also combined file is created but it is not shown in emitted output. Same error goes with npm run watch, here watcher doesn’t watch styles file for modifications.

Expected Behaviour

File should be shown in emitted output and watcher should watch for changes in mix.styles files

Steps To Reproduce:

Below is my webpack.mix.js

 mix.js('resources/assets/js/app.js', 'public/js/app.js')
   .sass('resources/assets/sass/app.scss', 'public/css/app.css')
   .styles([
       'resources/assets/application/css/font-awesome.min.css',
       'resources/assets/application/css/icofont.css',
       'resources/assets/application/css/slidr.css',
       'resources/assets/application/css/main.css',
       'resources/assets/application/css/responsive.css',
       'resources/assets/application/css/presets/preset1.css'
  ],'public/css/app-bundle.css');

  mix.js([
     'resources/assets/application/js/price-range.js',
      'resources/assets/application/js/main.js',
      'resources/assets/application/js/switcher.js'
  ],'public/js/app-bundle.js');
  • Now run npm run dev After successful execution you will see list of emitted files. But in list app-bundle.css will be missing. But files are being successfully combined in app-bundle.css but not shown in list.

  • Now run npm run watch Watcher will not watch for changes in files provided in mix.styles()

Edit 1

About styles() , scripts(), I agree that they are not run by watch

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ankurk91commented, Jun 4, 2017

Actually scripts() and styles() are being run in background when you run npm run watch. But laravel-mix does not notify about that on terminal. This has been discussed before, see

0reactions
JeffreyWaycommented, Jun 6, 2017

Fixed in 1.0 release, coming in a few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mix.styles() is excluded in emitted output list also watcher ...
Description: I installed fresh Laravel 5.4 application. Added simple code to webpack.mix.js for combining plain css, which is given below in ...
Read more >
Compiling Assets (Mix) - The PHP Framework For Web Artisans
When you run the dev or production scripts, all of your application's CSS and JavaScript assets will be compiled and placed in your...
Read more >
Watch and WatchOptions | webpack
Webpack can watch files and recompile whenever they change. ... It is possible to exclude a huge folder like node_modules using a regular...
Read more >
Laravel mix watch ignore multiple folders using watchOptions
Using Laravel Mix 6 trying to disable changes to /resources/view from rebuilding resources. ignored (anymatch-compatible definition) Defines ...
Read more >
TSConfig Reference - Docs on every TSConfig option
Note that TypeScript will never write an output file to a directory outside of outDir , and will never skip emitting a file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found