-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.js
164 lines (146 loc) · 3.39 KB
/
settings.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
/******************************************************************************************
Settings for gulp builds
******************************************************************************************/
var package = require("./package.json");
var config = require("./config.js");
// Source and destination dirs
var paths = {
static: {
source: "./src/",
target: config.target + "/",
targethtml: config.htmltarget + "/"
},
build: {
source: "./build/source/",
target: "./build/dest/"
},
copy: [
"fonts/*.*",
"img/**/*.*",
]
};
// List of JS files used and to be watched in various bundles
var lists = {
css: {
build: [
"less/themes/*.less"
],
master: [
"less/css.less"
],
watch: [
"less/**/*.less"
]
},
html: {
build: [
"html/*.html",
"html/*.json"
],
watch: [
"html/*.html",
"html/*.json"
]
},
apps: {
build: [
"./js/**/*-main.js"
],
partials: [
"./js/**/partials"
],
watch: [
"./js/**/*.js",
"./js/**/*.html"
]
},
lint: {
scripts: [
"./js/!(lib*)/**/*.js"
]
}
};
// Options for browserify
var browserify = {
insertGlobals: false,
detectGlobals: false,
debug: true,
basedir: paths.build.source,
paths: [
__dirname + "/src/js/libs"
],
cache: {}, // needed for watchify
packageCache: {} // needed for watchify
};
// Config for JS Linting
var eslintConfig = require("./eslint.js");
// Options for Babelify
var babelConfig = {
"presets": [
"es2015"
],
"plugins": [
"transform-decorators-legacy"
],
"ignore": [
"libs/**/*.js",
"libs-angular/**/*.js"
]
};
// Options for JS minifier
var uglify = {
compress: {
drop_console: true,
sequences: true, // join consecutive statements with the comma operator
properties: true, // optimize property access: a["foo"] ? a.foo
dead_code: true, // discard unreachable code
drop_debugger: true, // discard debugger statements
unsafe: false, // some unsafe optimizations (see below)
conditionals: true, // optimize if-s and conditional expressions
comparisons: true, // optimize comparisons
evaluate: true, // evaluate constant expressions
booleans: true, // optimize boolean expressions
loops: true, // optimize loops
unused: false, // drop unused variables/functions
hoist_funs: true, // hoist function declarations
hoist_vars: false, // hoist variable declarations
if_return: true, // optimize if-s followed by return/continue
join_vars: true, // join var declarations
cascade: true, // try to cascade `right` into `left` in sequences
side_effects: true, // drop side-effect-free statements
warnings: true
},
mangle: {
},
beautify: {
"ascii_only": true
}
};
// Options for HTML minifier
var minifiy = {
collapseWhitespace: true,
collapseInlineTagWhitespace: false,
removeComments: true,
caseSensitive: true
};
// Path array building utility function
function buildPathArray(prefix, pathlist) {
var list = [];
prefix = prefix || "";
for (var u = 0; u < pathlist.length; u++)
list.push(prefix + pathlist[u]);
return list;
};
module.exports = {
paths: paths,
lists: lists,
githash: "",
gitbranch: "",
babel: babelConfig,
browserify: browserify,
compress: true,
uglify: uglify,
minifiy: minifiy,
eslint: eslintConfig,
buildPathArray: buildPathArray
};