-
Notifications
You must be signed in to change notification settings - Fork 1
/
make
66 lines (59 loc) · 2.03 KB
/
make
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
#! /usr/bin/env node
'use strict'
var command = process.argv[2],
utils = require('./tasks/_utils'),
path = require('path'),
projectPath = path.resolve(),
esskOptions
try{
esskOptions = require(projectPath + path.sep + '.es6-sass')
esskOptions = utils.resolve(projectPath, esskOptions)
} catch(e){
command = 'init'
}
if(command === 'init'){
var init = require('./tasks/init')
init()
} else {
var eslint = require('./tasks/eslint'),
build = require('./tasks/build'),
sass = require('./tasks/sass'),
watch = require('./tasks/watch'),
minify = require('./tasks/minify')
switch(command) {
case 'eslint':
eslint(esskOptions)()
break
case 'build':
build(esskOptions)()
break
case 'sass':
sass(esskOptions)()
break
case 'watch':
watch(esskOptions)()
break
case 'minify':
minify(esskOptions)()
sass(esskOptions, 'compressed')()
break
case 'prod':
//eslint(esskOptions)
build(esskOptions)()
.then(sass(esskOptions, 'compressed'))
.then(minify(esskOptions))
.then(function () {
utils.print('ES6 and SASS successfully compiled!', 'confirm')
})
break
case 'help':
default:
utils.print('> es6-sass build # transpile and bundle es6 to es5 file', 'cool')
utils.print('> es6-sass sass # transpile .scss files to .css file', 'cool')
utils.print('> es6-sass eslint # apply eslint to js files', 'cool')
utils.print('> es6-sass minify # minify js an css files', 'cool')
utils.print('> es6-sass watch # enable watching mode to js an scss files', 'cool')
utils.print('> es6-sass prod # transpile then minify all production files files', 'cool')
utils.print('> es6-sass help # this help', 'cool')
}
}