gulp是否有可能在项目外部有输出路径

时间:2016-05-31 13:39:39

标签: gulp laravel-5.1 laravel-elixir

例如我有我的laravel项目,它有这种结构

./
--assets
---- postcss
------的style.css

我想在app app文件夹外输出那个style.css(根目录以上一级)。这是可能的(我正在运行灵药)

编辑: - 我的gulp文件

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


require('laravel-elixir-postcss');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir.extend('changePath', function() {
    gulp.task('css', function () {
        return gulp.src("./resources/assets/postcss/")
            .pipe($.cleanCss())
            .pipe(gulp.dest("../css/style.css"));
});

elixir(function(mix) {

  mix.postcss('style.css', {
    plugins:[ 
      //require('csstyle'),
      require('autoprefixer'),
      //require('cssnext'),
      require('lost'),
      require('postcss-font-magician')
      // require('stylelint')
    ] 
  })
  .changePath();
});

1 个答案:

答案 0 :(得分:0)

你不能上目的路径中的目录吗?例如:

/tmp