github.com/fanux/shipyard@v0.0.0-20161009071005-6515ce223235/controller/static/semantic/tasks/config/project/tasks.js (about)

     1  var
     2    console = require('better-console'),
     3    config  = require('../user'),
     4    release = require('./release')
     5  ;
     6  
     7  
     8  module.exports = {
     9  
    10    banner : release.banner,
    11  
    12    log: {
    13      created: function(file) {
    14        return 'Created: ' + file;
    15      },
    16      modified: function(file) {
    17        return 'Modified: ' + file;
    18      }
    19    },
    20  
    21    filenames: {
    22      concatenatedCSS            : 'semantic.css',
    23      concatenatedJS             : 'semantic.js',
    24      concatenatedMinifiedCSS    : 'semantic.min.css',
    25      concatenatedMinifiedJS     : 'semantic.min.js',
    26      concatenatedRTLCSS         : 'semantic.rtl.css',
    27      concatenatedMinifiedRTLCSS : 'semantic.rtl.min.css'
    28    },
    29  
    30    regExp: {
    31  
    32      comments: {
    33  
    34        // remove all comments from config files (.variable)
    35        variables : {
    36          in  : /(\/\*[\s\S]+?\*\/+)[\s\S]+?\/\* End Config \*\//,
    37          out : '$1',
    38        },
    39  
    40        // add version to first comment
    41        license: {
    42          in  : /(^\/\*[\s\S]+)(# Semantic UI )([\s\S]+?\*\/)/,
    43          out : '$1$2' + release.version + ' $3'
    44        },
    45  
    46        // adds uniform spacing around comments
    47        large: {
    48          in  : /(\/\*\*\*\*[\s\S]+?\*\/)/mg,
    49          out : '\n\n$1\n'
    50        },
    51        small: {
    52          in  : /(\/\*---[\s\S]+?\*\/)/mg,
    53          out : '\n$1\n'
    54        },
    55        tiny: {
    56          in  : /(\/\* [\s\S]+? \*\/)/mg,
    57          out : '\n$1'
    58        }
    59      },
    60  
    61      theme: /.*\/themes\/.*?(?=\/)/mg
    62  
    63    },
    64  
    65    settings: {
    66  
    67      /* Remove Files in Clean */
    68      del: {
    69        silent : true
    70      },
    71  
    72      /* Comment Banners */
    73      header: {
    74        title      : release.title,
    75        version    : release.version,
    76        repository : release.repository,
    77        url        : release.url
    78      },
    79  
    80      plumber: {
    81        less: {
    82          errorHandler: function(error) {
    83            if(error.filename.match(/theme.less/)) {
    84              console.error('Looks like your theme.config is out of date. You will need to add new elements from theme.config.example');
    85            }
    86            else {
    87              console.log(error);
    88              this.emit('end');
    89            }
    90          }
    91        }
    92      },
    93  
    94      /* What Browsers to Prefix */
    95      prefix: {
    96        browsers: [
    97          'last 2 version',
    98          '> 1%',
    99          'opera 12.1',
   100          'safari 6',
   101          'ie 9',
   102          'bb 10',
   103          'android 4'
   104        ]
   105      },
   106  
   107      /* File Renames */
   108      rename: {
   109        minJS     : { extname : '.min.js' },
   110        minCSS    : { extname : '.min.css' },
   111        rtlCSS    : { extname : '.rtl.css' },
   112        rtlMinCSS : { extname : '.rtl.min.css' }
   113      },
   114  
   115      /* Minified CSS Concat */
   116      minify: {
   117        processImport       : false,
   118        restructuring       : false,
   119        keepSpecialComments : 1
   120      },
   121  
   122      /* Minified JS Settings */
   123      uglify: {
   124        mangle           : true,
   125        preserveComments : 'some'
   126      },
   127  
   128      /* Minified Concat CSS Settings */
   129      concatMinify: {
   130        processImport       : false,
   131        restructuring       : false,
   132        keepSpecialComments : false
   133      },
   134  
   135      /* Minified Concat JS */
   136      concatUglify: {
   137        mangle           : true,
   138        preserveComments : false
   139      }
   140  
   141    }
   142  };