gulp - laravel Elixir 扩展任务无效
为情所困
为情所困 2017-05-16 16:47:39
0
1
327

求帮忙看看哪里有问题?

/**
 * resouces/assets/app文件夹内的每一个js都压缩并保存到public/app
 * Created by summer on 2017/3/1.
 */


var gulp = require('gulp');

var gulpIf = require('gulp-if');

var uglify = require('gulp-uglify');

var elixir = require('laravel-elixir');

elixir.extend('appJs', function (src, output) {

    var inputFilePath = src || '/resources/assets/app/';
    var outputFilePath = output || '/public/app/';


    new elixir.Task('appJs', function () {
        return gulp.src(inputFilePath + '/**/*.js')
            .pipe(gulpIf(elixir.config.production, uglify()))
            .pipe(gulp.dest(outputFilePath));
    })
});
G:\xampp\htdocs\orderManage>gulp appJs
[09:32:05] Using gulpfile G:\xampp\htdocs\orderManage\gulpfile.js
[09:32:05] Starting 'appJs'...
[09:32:05] Finished 'appJs' after 11 ms

在console里显示,appJs是执行了的,/public/app/没东西是咋回事···

为情所困
为情所困

全部回复(1)
PHPzhong

好吧,是

var inputFilePath = src || '/resources/assets/app/';
    var outputFilePath = output || '/public/app/';

有问题,前面加.或直接去掉/

var inputFilePath = src || './resources/assets/app/';
    var outputFilePath = output || './public/app/';
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板