apache_conf Gulp Config Modular

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf Gulp Config Modular相关的知识,希望对你有一定的参考价值。

// Pfadvariable
var src               = 'app';
var build             = 'build';
var development       = build + '/development';
var production        = build + '/production';
var srcAssets         = src + '/_assets';
var developmentAssets = build + '/assets';
var productionAssets  = production + '/assets';
var bower             = 'bower_components';
var vendor            = srcAssets + '/scss/vendor';
var docs              = 'docs/_Packages';

// Breakpoints
// Siehe dazu auch die Einstellungen in der _config.yml, Bereich "Responsive Images"
var extra = '1140',
    large = '940',
    medium = '720',
    small = '576'

module.exports = {
  //BrowserSync
  browserSync: {
    development: {
      server: {
        baseDir: [development, build, src]
      },
      port: 9999,
      // Keine Nachrichten an den Browser schicken
      notify: false,
      // Browser nicht automatisch öffnen
      open: false,
      files: [
        developmentAssets + '/css/*.css',
        developmentAssets + '/js/*.js',
        developmentAssets + '/images/**',
        developmentAssets + '/fonts/*'
      ]
    },
    production: {
      server: {
        baseDir: [production]
      },
      port: 9998,
      // Keine Nachrichten an den Browser schicken
      notify: false,
      // Browser nicht automatisch öffnen
      open: false
    }
  },
  //Delete
  delete: {
    development: {
      src: [
        development,
        developmentAssets + '/css',
        developmentAssets + '/js'
      ]
    },
    production: {
      src: [production]
    },
    respDest: {
      src: [
        developmentAssets + '/css',
        developmentAssets + '/js'
      ]
    },
    respSrc: {
      src: [
        srcAssets + '/images/' + small + '/*',
        srcAssets + '/images/' + medium + '/*',
        srcAssets + '/images/' + large + '/*',
        srcAssets + '/images/' + extra + '/*',
      ]
    },
    svg: {
      development: {
        src: development + '/downloads/vectors/*'
      },
      production: {
        src: production + '/downloads/vectors/*'
      }
    }
  },
  //Sass SCSS
  sass: {
    sassPaths: [
      bower + '/bootstrap/scss',
      bower + '/font-awesome/scss',
      bower + '/checkbox.css/dist/scss',
      bower + '/animate.css',
      bower + '/bourbon/app/assets/stylesheets',
      bower + '/elegant-icons/scss',
      bower + '/slider-pro/dist/css/slider-pro.css',
      docs + '/Owl Carousel/OwlCarousel-master/owl-carousel/owl.carousel.css',
      docs + '/Owl Carousel/OwlCarousel-master/owl-carousel/owl.theme.css',
      vendor
    ],
    src: srcAssets + '/scss/main.scss',
    dest: developmentAssets + '/css'
  },
  //Jekyll
  jekyll: {
    development: {
      src:    src,
      dest:   development,
      config: '_config.yml'
    },
    production: {
      src:    src,
      dest:   production,
      config: '_config.yml,_config.build.yml'
    }
  },
  //Fonts
  fonts: {
    development: {
      src:  [
        srcAssets + '/fonts/**/*.{eot,svg,ttf,woff,woff2,otf}',
        '!' + srcAssets + '/fonts/*.md'
      ],
      dest: developmentAssets + '/fonts'
    },
    production: {
      src:  [
          srcAssets + '/fonts/**/*.{eot,svg,ttf,woff,woff2,otf}'
      ],
      dest: productionAssets + '/fonts'
    }
  },
  //Scripts
  scripts: {
    production: {
      src: developmentAssets + '/js/*.js',
      dest: productionAssets + '/js'
    },
    development: {
      src: developmentAssets + '/js/*.js',
      dest: productionAssets + '/js'
    },
    head: {
      src: bower + '/modernizr/modernizr.js',
      dest: developmentAssets +  '/js'
    },
    foot: {
      src: [
        bower + '/jquery/dist/jquery.js',
        bower + '/tether/dist/js/tether.js',
        bower + '/bootstrap/dist/js/bootstrap.js',
        docs + '/MDB-Pro/js/mdb.js',
        bower + '/slider-pro/dist/js',
        docs + '/Owl Carousel/OwlCarousel-master/owl-carousel/owl.carousel.js',
        srcAssets + '/javascripts/app.js'
      ],
      dest: developmentAssets +  '/js'
    }
  },
  //Autoprefixer
  autoprefixer: {
    browsers: [
      'last 2 versions',
      'safari 5',
      'ie 8',
      'ie 9',
      'opera 12.1',
      'ios 6',
      'android 4'
    ],
    cascade: true
  },
  //Images
  images: {
    // small
    small: {
      src: srcAssets + '/images/*.{jpg,jpeg,png}',
      dest: srcAssets + '/images/' + small
    },
    // medium
    medium: {
      src: srcAssets + '/images/*.{jpg,jpeg,png}',
      dest: srcAssets + '/images/' + medium
    },
    // large
    large: {
      src: srcAssets + '/images/*.{jpg,jpeg,png}',
      dest: srcAssets + '/images/' + large
    },
    // extra
    extra: {
      src: srcAssets + '/images/*.{jpg,jpeg,png}',
      dest: srcAssets + '/images/' + extra
    },
    development: {
      src:  [
        srcAssets + '/images/**/*',
        '!' + srcAssets + '/images/**/*.md'
      ],
      dest: developmentAssets + '/images'
    },
    production: {
      src:  [
        srcAssets + '/images/**/*',
        '!' + srcAssets + '/images/**/*.md'
      ],
      dest: productionAssets + '/images'
    },
    // svg
    svg: {
      development: {
        src: src + '/downloads/vectors/*.svg',
        dest: development + '/downloads/vectors'
      },
      production: {
        src: src + '/downloads/vectors/*.svg',
        dest: production + '/downloads/vectors'
      }
    }
  },
  //Watch
  watch: {
    jekyll: [
      '_config.yml',
      '_config.build.yml',
      src + '/*.{html,markdown,md,yml,json,txt,xml}',
      src + '/_data/**/*.{json,yml,csv}',
      src + '/_includes/**/*.{html,xml}',
      src + '/_layouts/*.html',
      src + '/_plugins/*.rb',
      src + '/_posts/*.{markdown,md}',
      src + '/_pages/**/*.{html,markdown,md}'
    ],
    sass:    srcAssets + '/scss/**/*.{sass,scss}',
    scripts: srcAssets + '/javascripts/app.js',
    images:  srcAssets + '/images/**/*',
    svg:     src + '/downloads/vectors/*.svg'
  },
  //Optimization
  optimize: {
    uncss: {
      src: production + '/**/*.html'
    },
    css: {
      src:  developmentAssets + '/css/*.css',
      dest: productionAssets + '/css/',
      options: {}
    },
    js: {
      src:  developmentAssets + '/js/*.js',
      dest: productionAssets + '/js/',
      options: {}
    },
    images: {
      src:  developmentAssets + '/images/**/*.{jpg,jpeg,png,gif}',
      dest: productionAssets + '/images/',
      options: {
        optimizationLevel: 3,
        progessive: true,
        interlaced: true
      }
    },
    html: {
      src: production + '/**/*.html',
      dest: production,
      options: {
        collapseWhitespace: true
      }
    }
  },
  //Revision
  revision: {
    src: {
      assets: [
        productionAssets + '/css/*.css',
        productionAssets + '/js/*.js',
        productionAssets + '/images/**/*'
      ],
      base: production
    },
    dest: {
      assets: production,
      manifest: {
        name: 'manifest.json',
        path: productionAssets
      }
    }
  },
  //Collect
  collect: {
    src: [
      productionAssets + '/manifest.json',
      production + '/**/*.{html,xml,txt,json,css,js}',
      '!' + production + '/feed.xml'
    ],
    dest: production
  },
  //rsync
  // https://github.com/jerrysu/gulp-rsync
  rsync: {
    src: production + '/**',
    options: {
      destination: 'path-to-website-root',
      root: production,
      hostname: 'hostname',
      username: 'username',
      incremental: true,
      progress: true,
      recursive: true,
      clean: true,
      exclude: ['.DS_Store', '*README.md'],
      include: []
    }
  }
};

以上是关于apache_conf Gulp Config Modular的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 在gulp构建过程中创建配置模块。 (替换引号的想法来自:https://github.com/guzart/gulp-ng-constant/issues/26#

apache_conf 〜/的.config /鱼/ config.fish

apache_conf 我的〜/ .config / fish / config.fish文件

apache_conf config.json

apache_conf config.json

apache_conf config.yml