forked from pepyatka/pepyatka-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jakefile
44 lines (38 loc) · 1.17 KB
/
Jakefile
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
var exec = require('child_process').exec
task('default', ['themes'], function (params) {
});
desc('Compile js files.')
task('compile', function() {
var proc = exec('node ./node_modules/requirejs/bin/r.js -o build.js')
proc.on('exit', process.exit)
proc.stdout.pipe(process.stdout, { end: false })
proc.stderr.pipe(process.stderr, { end: false })
})
watchTask(['themes'], function () {
this.watchFiles.include([
'./themes/**/*.scss'
])
})
desc('Compile scss themes.')
task('themes', function () {
var sass = require('node-sass')
, fs = require('fs')
, result
, files = {
'./themes/fresh/app.scss': './public/css/themes/fresh/app.css',
'./themes/helvetica/app.scss': './public/css/themes/helvetica/app.css',
'./themes/common/common.scss': './public/css/common/common.css'
}
for (var value in files) {
result = sass.renderSync({
file: value,
outFile: files[value],
outputStyle: 'compressed',
sourceMap: true,
sourceMapContents: true
})
fs.writeFileSync(files[value], result.css)
fs.writeFileSync(files[value] + ".map", result.map)
console.log(files[value] + " has been prepared.")
}
})