-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
67 lines (64 loc) · 1.57 KB
/
Gruntfile.js
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
/*jshint camelcase: false */
/*global module:false */
module.exports = function(grunt) {
var _ = require('lodash');
var neuterOptions = {
template: '{%= src %}',
includeSourceURL: true,
basePath: 'src/javascripts/'
};
grunt.initConfig({
neuter: {
application: {
options: _.merge({includeSourceMap: true}, neuterOptions),
src: 'src/javascripts/edsa.js',
dest: 'src/dev/javascripts/edsa.js'
},
dist: {
options: neuterOptions,
src: 'src/javascripts/edsa.js',
dest: 'dist/javascripts/edsa.js'
}
},
sass: {
application: { files: { 'src/dev/stylesheets/edsa.css': 'src/stylesheets/edsa.scss' } },
dist: { files: { 'dist/stylesheets/edsa.css': 'src/stylesheets/edsa.scss' } }
},
// Source only development tasks
connect: {
application: {
options: {
base: 'src/dev',
port: 9002,
hostname: '*'
}
}
},
watch: {
neuter: {
files: ['src/javascripts/**/*.js'],
tasks: ['neuter:application']
},
sass: {
files: ['src/stylesheets/*.scss'],
tasks: ['sass:application']
}
},
// Dist only tasks
uglify: {
'dist/javascripts/edsa.min.js': 'dist/javascripts/edsa.js'
},
});
grunt.registerTask('default', [
'connect',
'neuter:application',
'sass:application',
'watch',
]);
grunt.registerTask('dist', [
'neuter:dist',
'sass:dist',
'uglify'
])
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
};