-
Notifications
You must be signed in to change notification settings - Fork 0
/
frs.config.js
279 lines (203 loc) · 7.39 KB
/
frs.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
//custom config options
module.exports = function(config, dirs) {
//require a module from core
//var extend = require(dirs.rootModules + 'extend');
/********************
Styles
*********************/
//change sourcemaps root
// config.styles.sourceMapsRoot = '/src/';
//enable sourcemaps for prod
// config.styles.prod.sourceMaps = true;
//change autoprefixer options
// config.styles.autoprefixer.remove = false;
//change cssnano options
// config.styles.cssNamenano.safe = false;
//inject - enable group-css-media-queries plugin (disabled by default as unsafe)
// config.styles.inject.optimizeMediaQueries = true;
var sassLint = require('gulp-sass-lint');
config.styles.inject.sass = function(stream) {
return stream
.pipe(sassLint({
rules: {
'no-css-comments': 0,
'property-sort-order': 0,
'no-color-literals': 0,
'no-trailing-whitespace': 0,
'mixins-before-declarations': 0,
'shorthand-values': 0,
'leading-zero': 0,
'class-name-format': [
1,
{
'allow-leading-underscore': true,
'convention': 'hyphenatedbem'
}
],
'empty-line-between-blocks': 0,
'variable-name-format': 0,
'brace-style': 0,
'no-warn': 0,
'nesting-depth': [
1,
{
'max-depth': 3
}
],
'zero-unit': 0
}
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
};
/********************
Fonts
*********************/
//inject - add a middleware plugin before writing the output
// var myPlugin = require('my-plugin');
// config.fonts.inject.dest = function(stream) {
// return stream.pipe(myPlugin());
// };
/********************
Sprites
*********************/
//modify default sprites item - example for responsive sprites
// config.sprites.items[0].options.algorithm = 'diagonal';
//modify default sprites item - example for animations (change Spritesmith algorithm options)
// config.sprites.items[0].options.algorithm = 'left-right';
// config.sprites.items[0].options.algorithmOpts = { sort: false };
//add a sprites item - full options (any option omitted will receive a default value)
/*
config.sprites.items.push({
name: 'name', //sprite base name, the only required parameter
src: dirs.src.sprites.main + 'name/**' + '/*.*', //source dir, concat used just to avoid comment ending
dest: dirs.dist.sprites, //dest dir, set to null to ignore
varPrepend: 'name-', //prepended before SASS sprite variable name
//Spritesmith options
options: {
imgName: 'name.png', //output sprite image name
imgPath: '../img/name.png', //path to the output image relative to the CSS file
cssName: '_name.scss', //name of the output SASS file created in the styles dir
cssSpritesheetName: 'name-spritesheet', //stylesheet is a SASS map containing info about all sprite images
cssVarMap: function (sprite) {
sprite.name = 'name-' + sprite.name; //sprite variable builder
}
}
});
*/
/********************
JS
*********************/
//store vendor and app code in separate files
config.js.concatVendorApp = false;
//change sourcemaps root
// config.js.sourceMapsRoot = '/src/';
//enable lint on change
config.js.inject.lint = true;
//allow build even if lint errored
config.js.inject.lintFailAfterError = false;
//disable Babel
config.js.inject.babel = false;
// config.lint.options.parserOptions.ecmaVersion = 5;
//handy comps references
var comps = config.js.comps,
compMain = comps.main;
//main JS: change filename to script.js
// compMain.filename = 'script.js';
//main JS: add prioritized files
// compMain.priority.vendor = ['carousel.js'];
// compMain.priority.app = ['core.js', 'app/init.js'];
//add a html5shiv comp (add a dependency in in your bower.json file first)
// comps.html5shiv = {
// bower: ['html5shiv'],
// excludeIn: true,
// watch: false
// }
//add a comp (full parameters)
// comps.comp_name = {
// filename: 'comp_filename', //set to false to not produce any output file (for sub-comps); if not set, defaults to comp id
// bower: ['**/*.js'], //set only name of the package
// vendor: ['**/*.js'], //path relative to the appropriate directory
// app: ['**/*.js'], //path relative to the appropriate directory
// //set prioritized paths
// priority: {
// vendor: [],
// app: []
// },
// //set other comp ids to include
// dependencies: [],
// //set comps to exclude all loaded scripts in other comps, e.g.
// //excludeIn: ['comp1', 'comp2'] //excluded in selected comps
// //excludeIn: true //excluded in all other comps
// //excludeIn: false //no exclusion
// excludeIn: false,
// watch: true //not needed, watch blocked only if false
// }
/********************
Images
*********************/
//change imagemin optimization level
// config.images.imagemin.optimizationLevel = 4;
/********************
Views
*********************/
//change htmlmin options
// config.views.htmlmin.collapseWhitespace = false;
// config.views.htmlmin.removeComments = false;
//disable htmlmin
// config.views.inject.optimize = false;
/********************
Custom dirs
*********************/
//watch and copy contents of "php" dir from src to dist
/*
config.customDirs.items.push({
name: 'php views', //optional, displayed in the console during watch
src: dirs.src.main + 'php/**' + '/*.php',
dest: dirs.dist.main + 'php/', //set to null to just watch the dir without copying (e.g. external backend views)
inject: {
//an object { dirInfo } (with this config) available as this.taskData from within inject functions
src: true, //function must return: a stream (if canceled) or a glob array passed to the src
limit: true, //gulp-changed plugin
dest: true,
//watch task, receives undefined and { id, dirInfo } with id and definition as a second parameter
watch: true,
//clean task, receives current glob to delete (see the clean task injector docs) and { dirInfo } with definition object as a second parameter
//not needed to disable if "dest" is null
clean: true
}
});
*/
/********************
Lint
*********************/
//change ESLint options - add allowed globals
// config.lint.options.globals = {
// angular: false
// }
//change ESLint options - customize rules
// config.lint.options.rules = {
// 'quotes': [2, 'single'],
// 'comma-dangle': [2, 'only-multiline']
// }
config.lint.options.rules = {
'indent': ['error', 2]
}
/********************
Browsersync
*********************/
//handy Browsersync options reference
var bsOpts = config.browserSync.options;
// bsOpts.host = 'website.local';
// bsOpts.port = 81;
bsOpts.notify = false;
//set proxy
// bsOpts.server = false;
// bsOpts.open = 'external';
// bsOpts.proxy = 'proxy.local';
/********************
Clean
*********************/
//disable images dir cleaning
// config.clean.inject.images = false;
}