Repository navigation
Expand file tree
/
Copy pathenv.js
More file actions
88 lines (71 loc) · 1.74 KB
/
Copy pathenv.js
File metadata and controls
88 lines (71 loc) · 1.74 KB
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
var fs = require('fs'),
util = require('util');
var APP_CONFIG_FILE = '.app',
BUILD_DIR = './build/',
BUILD_FILE_PREFIX = 'app';
module.exports = {
appDir: appDir,
buildDir: buildDir,
jsVendorSequence: jsVendorSequence,
jsAssetsSequence: jsAssetsSequence,
lessAssetsToWatch: lessAssetsToWatch,
cssVendors: cssVendors,
jsAssetsToWatch: jsAssetsToWatch,
mainLessFile: mainLessFile,
BUILD_DIR: BUILD_DIR,
BUILD_FILE_PREFIX: BUILD_FILE_PREFIX,
APP_CONFIG_FILE: APP_CONFIG_FILE
}
function appDir() {
return readFile(APP_CONFIG_FILE);
}
function buildDir() {
return BUILD_DIR + appDir();
}
function jsVendorSequence() {
return [
'./vendor/underscore/underscore.js',
'./vendor/markdown/lib/markdown.js',
'./vendor/jquery/dist/jquery.min.js',
'./vendor/jquery-form/jquery.form.js',
'./vendor/angular/angular.js',
'./vendor/angular-animate/angular-animate.js',
'./vendor/angular-route/angular-route.js',
'./vendor/angular-loading-bar/src/loading-bar.js'
];
}
function cssVendors() {
return ['./vendor/angular-loading-bar/src/loading-bar.css'];
}
function jsAssetsSequence() {
var format = getFormatter();
return [
'./%s/**/*.module.js',
'./%s/*/**/*.js',
'./%s/app.js'
].map(format);
}
function lessAssetsToWatch() {
var format = getFormatter();
return [
'./less/%s/**/*.less',
'./less/%s/**/*.css'
].map(format);
}
function jsAssetsToWatch() {
var format = getFormatter();
return format('./%s/**/*.js');
}
function mainLessFile() {
var format = getFormatter();
return format('./less/%s/app.less');
}
function getFormatter() {
return formatStr.bind(null, appDir());
}
function formatStr(str, format) {
return util.format(format, str);
}
function readFile(path) {
return fs.readFileSync(path, { encoding: 'utf8' });
}