2016-04-08 10 views
2

Wie kann ich mehrere JS-Dateien kopieren und verketten?Elixir und Gulp - Kopieren und verketten

Ich habe gehofft, so etwas wie dies funktionieren würde:

.copy([ 
      'node_modules/bootstrap-sass/assets/javascripts/bootstrap.js', 
      'node_modules/magnific-popup/dist/jquery.magnific-popup.js' 
     ], 
     'public/js/plugins.js' 
    ); 

Aber nur die spätere Datei (magnific-popup.js) ausgegeben plugins.js.

Antwort

2

Versuchen mix.scripts statt copy mit:

elixir(function(mix) { 
    mix.scripts(
     // Source files 
     [ 
      'node_modules/bootstrap-sass/assets/javascripts/bootstrap.js', 
      'node_modules/magnific-popup/dist/jquery.magnific-popup.js' 
     ], 
     // Destination 
     'public/js/plugins.js' 
    ); 
}); 
+1

Ah! Ja Dankeschön. Musste die Quelldateipfade etwas ändern ('../../../ node_modules/etc'), aber jetzt alle arbeiten. –