-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
121 lines (118 loc) · 4.22 KB
/
Gruntfile.js
File metadata and controls
121 lines (118 loc) · 4.22 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
jshint: {
options: {
reporter: require('jshint-stylish')
},
all: ['Gruntfile.js', 'assets/js/**/*.js']
},
jslint: {
builder: {
src: ['Gruntfile.js'],
directives: {
predef: ['module', 'require', 'console']
}
},
all: {
src: ['assets/js/**/*.js'],
directives: {
browser: true,
plusplus: true,
devel: true,
predef: ['define', 'require']
}
}
},
watch: {
tests: {
files: ['spec/**/*.js'],
tasks: ['jshint', 'jslint', 'jasmine']
},
scripts: {
files: ['src/client/**/*.js', 'assets/**/*.js', 'index.js'],
tasks: ['jshint', 'jslint', 'uglify:scripts', 'jasmine']
},
legacy: {
files: ['assets/**/*.js'],
tasks: ['jshint', 'jslint', 'jasmine']
},
entry: {
files: ['index.js'],
tasks: ['jshint', 'jslint']
},
styles: {
files: ['src/**/*.scss'],
tasks: ['sass']
},
jsx: {
files: ['src/client/ComponentProvider.jsx'],
tasks: ['react']
},
jsxDist: {
files: ['dist/assets/js/ComponentProvider.js'],
tasks: ['jshint', 'jslint', 'uglify:jsx', 'jasmine']
}
},
jasmine: {
tests: {
src: 'assets/js/**/*.js, src/client/**/*.js',
options: {
specs: 'spec/*Spec.js',
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: 'dist/assets/js',
paths: {
React: 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xap1/t39.3284-6/' +
'11057094_1387833628212425_492117912_n'
}
}
}
}
}
},
sass: {
compile: {
files: {
'dist/assets/css/main.css': 'src/client/main.scss',
'dist/assets/css/registry.css': 'src/client/registry.scss'
},
options: {
loadPath: ['node_modules/bootstrap-sass/assets/stylesheets'],
style: 'compressed',
compass: true
}
}
},
uglify: {
options: {sourceMap: true, sourceMapIncludeSources: true},
vendors: {files: {'dist/assets/js/vendor/require.js': 'node_modules/requirejs/require.js'}},
scripts: {files: grunt.file.expandMapping('src/client/**/*.js', 'dist/assets/js/', {flatten: true})},
jsx: {files: {'dist/assets/js/ComponentProvider.js': 'dist/assets/js/ComponentProvider.js'}}
},
lodash: {
build: {
dest: 'dist/assets/js/vendor/lodash.js',
options: {
modifier: 'modern',
exports: ['amd'],
include: ['isEmpty', 'has', 'includes', 'assign', 'forEach', 'map']
}
}
},
react: {
build: { files: { 'dist/assets/js/ComponentProvider.js': 'src/client/ComponentProvider.jsx' } }
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-lodash');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-react');
grunt.registerTask('default', ['sass', 'react', 'lodash', 'uglify']);
};