-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathconfig.js
164 lines (160 loc) · 4.98 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/**
* 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/',
scriptMain: 'main.js',
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/',
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 (first transform is applied first)
// transform-name: transform-is-enabled (true or false)
}
},
copy: [
/* List of folders that will be copied to dist folder */
// example: 'images/sprites/**/*', 'humans.txt', 'bower_components/jquery/dist/jquery.js'
],
defaultDependencies: [
/* Add custom tasks to run as dependencies to the `default` task */
// Put here task names for tasks that are executed once after launching Gulp
// Related: indexDependencies
],
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
keepClosingSlash: true // keep the trailing slash on singleton elements - SVG doesn't break with this is enabled
},
imagemin: {
/* Minify PNG, JPEG, GIF and SVG images */
enabled: false // disabled (edit images task have this functionality)
},
indexDependencies: [
/* Add custom tasks to run as dependencies to the `index` task */
// Task names for tasks that are executed in every incremental build (after file save) should go here
// Related: defaultDependencies
],
jshint: {
enabled: false
},
jscs: {
enabled: false
},
less: {
/* Less style file compilation */
enabled: true,
compress: false, // remove whitespace from CSS
paths: [ // directories for locating Less files
'src/styles/',
'src/bower_components/'
]
},
livereload: {
/* Reload page in browser when build is finished */
enabled: true,
port: 35729
},
minifyCss: {
/* Minify CSS code */
// Option list: https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-programmatically
enabled: true,
compatibility: 'ie8'
},
newer: {
/* Process only changed files */
enabled: true
},
ngAnnotate: {
/* Rewrites AngularJS code to be minification-proof */
enabled: false
},
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 + '[' + chalk.magenta(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);
if(plugin == "browserify") {
console.log(err);
} else {
console.log(chalk.red(err.message));
}
}
},
rename: {
/* Rename files (used for revisioning) */
enabled: false
},
sourcemaps: {
enabled: true,
loadMaps: true
},
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
},
uglify: {
/* Minify JS code */
enabled: false,
compress: false
},
watch: {
/* Run build each time file is changed */
enabled: true
}
};