-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.coffee
76 lines (72 loc) · 1.93 KB
/
Gruntfile.coffee
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
fs = require 'fs'
env = {}
try
file = fs.readFileSync '.env', 'utf8'
arr = file.split('\n')
arr.pop() if not arr[arr.length]
for item in arr
key = item.split('=')[0]
val = item.split('=')[1]
env[key] = val
catch e
module.exports = (grunt) ->
grunt.initConfig
less:
all:
options:
paths: ['./dist/css']
compress: true
files:
'./dist/css/main.css': './src/less/main.less'
coffee:
compile:
files:
'./dist/js/app.js': [
'./src/iced/main.iced'
'./src/iced/vault.iced',
'./src/iced/archivist.iced',
]
browserify:
'./dist/js/bundle.js': ['./dist/js/app.js']
options:
exclude: ['openpgp']
transform: ['coffeeify', 'vueify']
browserifyOptions:
extensions: '.iced'
paths: ['./src/iced']
copy:
lib:
expand: true
flatten: true
cwd: './'
src: [
'node_modules/openpgp/dist/openpgp.min.js'
'node_modules/openpgp/dist/openpgp.worker.min.js'
]
dest: 'dist/js/'
watch:
iced:
files: ['./**/*.iced']
tasks: ['coffee']
less:
files: ['./**/*.less']
tasks: ['less']
options: {livereload: true}
vue:
files: ['./**/*.vue']
tasks: ['browserify']
options: {livereload: true}
html:
files: ['./**/*.htm*']
options: {livereload: true}
js:
files: ['./dist/js/app.js']
tasks: ['browserify']
options: {livereload: true}
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-iced-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.registerTask 'dev', ['less', 'coffee', 'copy', 'browserify', 'watch']
grunt.registerTask 'default', ['less', 'coffee', 'copy', 'browserify']