为什么 Laravel Elixir 没有缩小我的代码?
Why is Laravel Elixir is not minifying my code?
我正在使用 laravel 长生不老药来编译和压缩我的代码。但是由于某种原因,当我执行 gulp -production 任务时,我仍然没有得到缩小的代码。我很想缩小 javascript 和 css 生产代码。
我的gulp文件:
'use strict';
process.env.DISABLE_NOTIFIER = false;
var elixir = require('laravel-elixir');
var autoprefixer = require('gulp-autoprefixer');
elixir(function(mix) {
mix.sass([
'./resources/assets/css/**/**/*.scss'
], 'public/css/style.css');
mix.scripts([
'app.js'
], 'public/js/angular/app.js');
mix.scripts([
'jquery/chosenSelect.js',
'jquery/fileUpload.js',
'jquery/velocity.min.js',
'jquery/leanModal.js',
'jquery/sectionScroll.js'
], 'public/js/jquery.js');
mix.scripts([
'services/OverheatingService.js'
], 'public/js/angular/services/services.js');
mix.scripts([
'controllers/LoopController.js',
'controllers/AlertController.js',
'controllers/LibraryController.js',
'controllers/StationController.js',
'controllers/ProfileController.js',
'controllers/HomeController.js',
'controllers/MainController.js',
'controllers/RecordController.js',
'controllers/SpecificuserController.js',
'controllers/DeleteAccountController.js',
'controllers/RegisterController.js',
'controllers/EditProfileController.js',
'controllers/SpecificLoopController.js',
'controllers/SpecificTagController.js'
], 'public/js/angular/controllers/controllers.js');
mix.scripts([
'directives/tooltip.js',
'directives/smoothScroll.js'
], 'public/js/angular/directives/directives.js');
});
//To watch changes in sass files
elixir.Task.find('sass').watch('./resources/assets/css/**/*.scss');
命令是 gulp --production
不是 gulp - production
。
您也可以看看 Elixir Docs for Running Elixir。
我正在使用 laravel 长生不老药来编译和压缩我的代码。但是由于某种原因,当我执行 gulp -production 任务时,我仍然没有得到缩小的代码。我很想缩小 javascript 和 css 生产代码。
我的gulp文件:
'use strict';
process.env.DISABLE_NOTIFIER = false;
var elixir = require('laravel-elixir');
var autoprefixer = require('gulp-autoprefixer');
elixir(function(mix) {
mix.sass([
'./resources/assets/css/**/**/*.scss'
], 'public/css/style.css');
mix.scripts([
'app.js'
], 'public/js/angular/app.js');
mix.scripts([
'jquery/chosenSelect.js',
'jquery/fileUpload.js',
'jquery/velocity.min.js',
'jquery/leanModal.js',
'jquery/sectionScroll.js'
], 'public/js/jquery.js');
mix.scripts([
'services/OverheatingService.js'
], 'public/js/angular/services/services.js');
mix.scripts([
'controllers/LoopController.js',
'controllers/AlertController.js',
'controllers/LibraryController.js',
'controllers/StationController.js',
'controllers/ProfileController.js',
'controllers/HomeController.js',
'controllers/MainController.js',
'controllers/RecordController.js',
'controllers/SpecificuserController.js',
'controllers/DeleteAccountController.js',
'controllers/RegisterController.js',
'controllers/EditProfileController.js',
'controllers/SpecificLoopController.js',
'controllers/SpecificTagController.js'
], 'public/js/angular/controllers/controllers.js');
mix.scripts([
'directives/tooltip.js',
'directives/smoothScroll.js'
], 'public/js/angular/directives/directives.js');
});
//To watch changes in sass files
elixir.Task.find('sass').watch('./resources/assets/css/**/*.scss');
命令是 gulp --production
不是 gulp - production
。
您也可以看看 Elixir Docs for Running Elixir。