2
我想將我的靈丹妙藥的任務分成不同的Gulp任務,所以我可以運行它們的一個子集。Laravel Elixir沒有運行內部任務
這裏是我的gulpfile.js
:
var gulp = require('gulp'),
elixir = require('laravel-elixir');
/**
* CSS
*/
gulp.task('styles', function()
{
elixir(function(mix)
{
mix.sass('auth.scss')
.sass('main.scss')
.sass('dashboard.scss')
.sass('contact.scss')
.sass('login.scss')
.sass('campaign_creator.scss')
.sass('campaign_stats.scss');
});
});
/**
* JS
*/
gulp.task('scripts', function()
{
elixir(function(mix)
{
mix.scriptsIn('public/js/src/shared', 'public/js/dist/shared/all.js')
.scriptsIn('public/js/src/logins', 'public/js/dist/logins/all.js')
.scriptsIn('public/js/src/campaign', 'public/js/dist/campaigns/all.js')
// vendor scripts used in multiple places can be kept separate rather than concatenated with the page's JS files
.copy('public/vendor/alertifyjs/dist/js/alertify.js', 'public/js/dist/vendor/alertifyjs/alertify.js');
});
});
gulp.task('default', [ 'styles', 'scripts' ]);
運行的是styles
或scripts
任務產生任何影響。如果我在終端中運行默認任務gulp
,那麼styles
或scripts
任務將無效,但elixir任務成功運行。
端子輸出:
gulp
[12:28:54] Using gulpfile /path/to/my/app/application/gulpfile.js
[12:28:54] Starting 'styles'...
[12:30:03] Finished 'styles' after 1.13 min
[12:30:03] Starting 'scripts'...
[12:30:03] Finished 'scripts' after 63 ms
[12:30:03] Starting 'default'...
[12:30:03] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/auth.scss
Saving To...
- public/css/auth.css
[12:30:25] Finished 'default' after 22 s
[12:30:27] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:27] Finished 'sass' after 24 s
[12:30:27] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/main.scss
Saving To...
- public/css/main.css
[12:30:27] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:27] Finished 'sass' after 504 ms
[12:30:27] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/dashboard.scss
Saving To...
- public/css/dashboard.css
[12:30:27] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:27] Finished 'sass' after 200 ms
[12:30:27] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/contact.scss
Saving To...
- public/css/contact.css
[12:30:28] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:28] Finished 'sass' after 289 ms
[12:30:28] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/login.scss
Saving To...
- public/css/login.css
[12:30:28] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:28] Finished 'sass' after 210 ms
[12:30:28] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/campaign_creator.scss
Saving To...
- public/css/campaign_creator.css
[12:30:28] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:28] Finished 'sass' after 218 ms
[12:30:28] Starting 'sass'...
Fetching Sass Source Files...
- resources/assets/sass/campaign_stats.scss
Saving To...
- public/css/campaign_stats.css
[12:30:29] gulp-notify: [Laravel Elixir] Sass Compiled!
[12:30:29] Finished 'sass' after 477 ms
[12:30:29] Starting 'scriptsIn'...
Fetching ScriptsIn Source Files...
- public/js/src/shared/**/*.js
Saving To...
- public/js/dist/shared/all.js
[12:30:56] gulp-notify: [Laravel Elixir] Scripts Merged!
[12:30:56] Finished 'scriptsIn' after 27 s
[12:30:56] Starting 'scriptsIn'...
Fetching ScriptsIn Source Files...
- public/js/src/logins/**/*.js
Saving To...
- public/js/dist/logins/all.js
[12:30:57] gulp-notify: [Laravel Elixir] Scripts Merged!
[12:30:57] Finished 'scriptsIn' after 738 ms
[12:30:57] Starting 'scriptsIn'...
Fetching ScriptsIn Source Files...
- public/js/src/campaign/**/*.js
Saving To...
- public/js/dist/campaigns/all.js
[12:30:57] gulp-notify: [Laravel Elixir] Scripts Merged!
[12:30:57] Finished 'scriptsIn' after 609 ms
[12:30:57] Starting 'copy'...
Fetching Copy Source Files...
- public/vendor/alertifyjs/dist/js/alertify.js
Saving To...
- public/js/dist/vendor/alertifyjs/alertify.js
[12:30:58] Finished 'copy' after 298 ms
我在做什麼錯?