Question: Using multiple webpack methods on laravel elixir


Using multiple webpack methods on laravel elixir

Answers 1
Added at 2017-01-05 19:01

I'm using Laravel 5.3 and Elixir:

"laravel-elixir": "^6.0.0-9",
"laravel-elixir-rollup-official": "^1.0.5",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-webpack-official": "^1.0.2",

I'm using multiple wepback methods in my gulpfile.js file, as you can see here:

elixir(mix => {
        .copy('node_modules/font-awesome/fonts', 'public/build/fonts')
        .sass('client.scss', 'public/css/client.css')
        .sass('panel.scss', 'public/css/panel.css')
        // .webpack('app.js')
        .version(['css/client.css', 'css/panel.css', 'js/app.js', 'js/panel.js']);

I've noticed that (sometimes) when I use multiple webpack methods, and run gulp watch, I get this error:

  throw er; // Unhandled stream error in pipe.

Error: ENOENT: no such file or directory, stat '...\build\js\app-6ced943929.js'
at Error (native)

Is it wrong to use multiple times with the method webpack? Is there an alternative way to separate 2 different js files?

nr: #1 dodano: 2017-01-05 21:01

Not 100% sure regarding this particular case, but you can just invoke a new stream for this and you should be able to avoid the issue:



Of course your .version() would then need to be added to each stream separately so there is the introduction of a bit of code redundancy.

Source Show
◀ Wstecz