-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGruntfile.js
60 lines (60 loc) · 1.85 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
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
my_target: {
files: {
'dist/ng-image-appear.min.js': ['src/js/build/ng-image-appear.js']
}
}
},
cssmin: {
target: {
files: {
'src/css/build/animations.min.css': ['src/css/build/animations.min.css']
}
}
},
autoprefixer: {
dist: {
files: {
'src/css/build/animations.min.css': 'src/css/animations.css'
}
}
},
watch: {
scripts: {
files: ['src/js/ng-image-appear.js'],
tasks: ['string-replace', 'uglify'],
options: {
spawn: false,
},
},
styles: {
files: ['src/css/animations.css'],
tasks: ['autoprefixer', 'cssmin', 'string-replace', 'uglify'],
options: {
spawn: false,
},
},
},
'string-replace': {
inline: {
files: {
'src/js/build/ng-image-appear.js': 'src/js/ng-image-appear.js',
},
options: {
replacements: [{
pattern: '@animation',
replacement: '<%= grunt.file.read("src/css/build/animations.min.css") %>'
}]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.registerTask('default', ['watch']);
};