forked from madebysource/pho-devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
144 lines (140 loc) · 4.4 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
* This file contains default options for dev stack
*/
'use strict';
var path = require('path');
var chalk = require('chalk');
module.exports = {
dist: {
/* Directories and file patterns for build output */
markupDir: 'dist/',
scriptDir: 'dist/scripts/',
styleDir: 'dist/styles/',
imageDir: 'dist/images/',
spriteDir: 'dist/images/sprites/',
markupFiles: '**/*.html',
scriptFiles: '*.js',
styleFiles: '*.css'
},
src: {
/* Directories and file patterns of source files */
markupDir: 'src/',
scriptDir: 'src/scripts/',
styleDir: 'src/styles/',
specDir: 'spec/',
imageDir: 'src/images/',
e2eDir: 'e2e/',
scriptMain: 'main.js',
styleMain: 'main.less',
markupFiles: '**/*.html',
scriptFiles: '**/*.js',
styleFiles: '**/*.less',
specFiles: '**/*Spec.js'
},
base64: {
enabled: false,
maxImageSize: 32768 // maximum filesize for replacing image with base64
},
browserify: {
/* Parses javascript module files with require() functions and produces single bundle */
/* Option list: https://github.com/substack/node-browserify#bbundleopts-cb */
enabled: true, // each plugin can be enabled or disabled by setting this property
debug: true, // enable source maps
detectGlobals: false, // performance optimization
transforms: { // transforms can be used for tasks like minification
// order matters (ngmin wouldn't work after minification)
// transform-name: transform-is-enabled (true or false)
"browserify-ngmin": false, // rewrite AngularJS code to be minification-proof
uglifyify: false // minifies module with UglifyJS
}
},
clean: {
/* Clean folder before generating build output (useful for folders with revisioned files) */
enabled: true
},
copy: [
/* List of folders that will be copied to dist folder */
// example: 'images/sprites/**/*', 'humans.txt', 'bower_components/jquery/dist/jquery.js'
],
filter: {
/* Used internally for generating sprites */
enabled: true
},
htmlmin: {
/* Markup minification */
/* Option list: https://github.com/kangax/html-minifier#options-quick-reference */
enabled: true,
collapseWhitespace: true, // remove whitespace characters from text nodes and document tree
removeComments: true // strip HTML comments
},
indexDependencies: [
/* Add custom tasks to run as dependencies to the `index` task */
],
jshint: {
enabled: false
},
jscs: {
enabled: false
},
karma: {
/* Test runner for JavaScript */
// configure it in karma.conf.js
enabled: false
},
imagemin: {
/* Minify PNG, JPEG, GIF and SVG images */
enabled: false // temporarily disabled (unreliable plugin)
},
less: {
/* LESS style file compilation */
enabled: true,
compress: true, // remove whitespace from CSS
paths: [ // directories for locating less files
'src/styles/',
'src/bower_components/lesshat/build'
],
sourceMap: true // enable source maps
},
livereload: {
/* Reload page in browser when build is finished */
enabled: true
},
newer: {
/* Process only changed files */
enabled: true
},
plumber: {
/* Handle errors in a way that Gulp doesn't crash */
enabled: true,
errorHandler: function(err, plugin) { // custom error message output
var beep = '\x07';
var message = beep + '[' + (plugin || err.plugin) + '] ' + err.name;
if (err.fileName) {
message += ' in ' + path.relative(process.cwd(), err.fileName) + ':' + chalk.bold(err.lineNumber);
} else if (err.lineNumber) {
message += ' at line ' + chalk.bold(err.lineNumber);
}
console.log(message);
console.log(chalk.red(err.message));
}
},
rename: {
/* Rename files (used for revisioning) */
enabled: false
},
spritesPreprocessor: {
/* Replace images in sprites folder with one image, and change css paths */
enabled: false,
path: 'src/images/sprites/', // path to the source image files
prefix: '../images/sprites/', // CSS prefix in image url to know what images transform into sprites
name: '../images/sprites/sprite.png' // name of the output sprite file
},
substituter: {
/* Replace any text in markup with specified value */
enabled: true
},
watch: {
/* Run build each time file is changed */
enabled: true
}
};