UNPKG

1.91 kBtext/coffeescriptView Raw
1module.exports = (grunt) ->
2
3 grunt.initConfig
4
5 aws: grunt.file.readJSON('./aws_key.json')
6
7 clean:
8 source: ['./lib/*.js']
9
10 coffee:
11 sourceFiles:
12 expand: true,
13 flatten: true,
14 cwd: './src',
15 src: ['*.coffee'],
16 dest: './lib/',
17 ext: '.js'
18
19 testFiles:
20 expand: true,
21 flatten: true,
22 cwd: './test/specs/src',
23 src: ['*.coffee'],
24 dest: './test/specs/',
25 ext: '.js'
26
27 watch:
28 source:
29 files: ["src/*.coffee"]
30 tasks: ['clean','coffee:sourceFiles',"jasmine:salesforceModel"]
31
32 test_src:
33 files: ["test/specs/src/*.coffee"]
34 tasks: ['coffee:testFiles',"jasmine:salesforceModel"]
35
36 jasmine:
37 model:
38 src: ["./lib/index.js"]
39 options:
40 specs: ['./specs/class.js', './specs/events.js' , './specs/model.js']
41
42 browserify:
43 basic:
44 src: ['lib/index.js']
45 dest: 'dist/3model.v1.js'
46 options:
47 alias: ['./lib/index.js:3vot-model']
48
49 s3:
50 options:
51 key: '<%= aws.key %>',
52 secret: '<%= aws.secret %>',
53 bucket: 'dist.3vot.com',
54 access: 'public-read',
55 headers:
56 "Cache-Control": "max-age=0, public",
57 "Expires": new Date(Date.now() + 1).toUTCString()
58
59 dev:
60 upload: [
61 src: './dist/*.*',
62 options: { gzip: true }
63 ]
64
65
66 grunt.loadNpmTasks('grunt-contrib-clean');
67 grunt.loadNpmTasks('grunt-contrib-coffee');
68 grunt.loadNpmTasks('grunt-contrib-jasmine');
69 grunt.loadNpmTasks('grunt-contrib-watch');
70
71 grunt.loadNpmTasks('grunt-browserify');
72 grunt.loadNpmTasks('grunt-s3');
73
74
75 grunt.registerTask("pack",["coffee", "browserify"])
76
77 grunt.registerTask("dev",["coffee", "browserify", "s3"])
78
79 grunt.registerTask('default', ['clean','coffee', "browserify" , 'jasmine']);
\No newline at end of file