1 | module.exports = (grunt) ->
|
2 |
|
3 | grunt.initConfig
|
4 |
|
5 | clean:
|
6 | source: ['./lib/*.js']
|
7 |
|
8 | coffee:
|
9 | sourceFiles:
|
10 | expand: true,
|
11 | flatten: true,
|
12 | cwd: './src',
|
13 | src: ['*.coffee'],
|
14 | dest: './lib/',
|
15 | ext: '.js'
|
16 |
|
17 | testFiles:
|
18 | expand: true,
|
19 | flatten: true,
|
20 | cwd: './test/specs/src',
|
21 | src: ['*.coffee'],
|
22 | dest: './test/specs/',
|
23 | ext: '.js'
|
24 |
|
25 | watch:
|
26 | source:
|
27 | files: ["src/*.coffee"]
|
28 | tasks: ['clean','coffee:sourceFiles',"jasmine:salesforceModel"]
|
29 |
|
30 | test_src:
|
31 | files: ["test/specs/src/*.coffee"]
|
32 | tasks: ['coffee:testFiles',"jasmine:salesforceModel"]
|
33 |
|
34 | jasmine:
|
35 | model:
|
36 | src: ["./lib/index.js"]
|
37 | options:
|
38 | specs: ['./specs/class.js', './specs/events.js' , './specs/model.js']
|
39 |
|
40 | browserify:
|
41 | basic:
|
42 | src: ['lib/index.js']
|
43 | dest: 'dist/3model.js'
|
44 | options:
|
45 | alias: ['./lib/index.js:3vot-model']
|
46 |
|
47 | ajax:
|
48 | src: ['lib/ajax.js']
|
49 | dest: 'dist/3ajax.js'
|
50 | options:
|
51 | alias: ["./lib/ajax.js:_3Ajax"]
|
52 | external: ["3vot-model"]
|
53 |
|
54 | grunt.loadNpmTasks('grunt-contrib-clean');
|
55 | grunt.loadNpmTasks('grunt-contrib-coffee');
|
56 | grunt.loadNpmTasks('grunt-contrib-jasmine');
|
57 | grunt.loadNpmTasks('grunt-contrib-watch');
|
58 |
|
59 | grunt.loadNpmTasks('grunt-browserify');
|
60 |
|
61 | grunt.registerTask("pack",["coffee", "browserify"])
|
62 |
|
63 | grunt.registerTask('default', ['clean','coffee', "browserify" , 'jasmine']); |
\ | No newline at end of file |